Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql question

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
I have the following statement:

SELECT
people.*
FROM
people, acquaintance
WHERE ID = Person_ID
ORDER BY case when (Is_Friend = 1) then First_Name, Last_Name else Nickname;


which won't work...

trying to change it to this, but am a little unsre as to strucute



SELECT
people.*,
case when (Is_Friend = 1) then concat(' ', First_Name, Last_Name) as sort_name
else Nickname as sort_name end
FROM
people, acquaintance

Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top