Solved

Help with MySql SELECT statement: SELECT lname, fname

Posted on 2009-07-09
3
711 Views
Last Modified: 2013-12-13
Help with MySql SELECT statement: SELECT lname, fname

SELECT lname "," fname as 'STUDEN NAME'
FROM intenrollment
WHERE confirm = 'Y' and policyno='2008

I want the name to look like this: Anderson, Tom
0
Comment
Question by:Willy3g
3 Comments
 
LVL 8

Accepted Solution

by:
stefanx earned 500 total points
Comment Utility
SELECT CONCAT(lname,', ',fname) FROM intenrollment
0
 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
Comment Utility
You are missing , in your query, try this :

SELECT trim(lname), ",",trim(fname) as 'STUDEN NAME'
FROM intenrollment
WHERE confirm = 'Y' and policyno='2008'

Bm keshav

0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
Comment Utility
I would do it using concat also. but watch out if either lname or fname is null, the whole thing will come out as null
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now