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
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