-
displaying part of a field
im new to all this.
what i wanted to do was seach through a database and extract just the first letter from both a field firstname and lastname from table customers.
so i get JD from John , Doe
i got the search okey too look up the names but how do i display them in "JD" just the initials on a new column?
any help would be great.
Thank you in advance
-
select fname,lname,left(fname,1)+left(lname,1) as Newinitial from tablename
-
OOPS. I forgot it is MYSQL.
here you go
SELECT fname,lname,CONCAT(left(lname,1),left(lname,1)) from test1;
-
SELECT fname,lname,CONCAT(left(fname,1),left(lname,1)) from test1;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|