I am trying to achieve the following:
I have a single ORDER BY statement which could vary depending on the value stored in Column A.
For example:
if the Type is Member, sort by member last name if the Type is Group, sort by the Group Name
both in Ascending order.
My best guess for the final statement would be:
SELECT *
FROM table
WHERE STATUS = 'Active'
ORDER BY ((LNAME if TYPE = 'Member') OR (GROUPNAME if TYPE = 'Group')) ASC
I know this is incorrect but cannot find information elsewhere. Any ideas?