If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I would like to query one table and select one customer with a specific ID (Customer A) and then obtain all the other customers from the table. The presentation order must be Customer A followed by all the other customers in order of birth date (asc). Customer A's birthdate shouuld not be included in the ordering because he needs to be at the top of the list. Any suggestions would be appreciated. Thanks!
This does not give me the correct order but shows conceptually what I am trying to get at:
Select
SESSIONID, CUSTOMERNAME, CUSTOMERID, CUSTOMERDOB
FROM CUSTOMER
WHERE CUSTOMERID = 1234567894
UNION
Select
SESSIONID, CUSTOMERNAME, CUSTOMERID, CUSTOMERDOB
FROM CUSTOMER
ORDER BY CUSTOMERDOB ASC
Select
SESSIONID, CUSTOMERNAME, CUSTOMERID, CUSTOMERDOB, 1 DUMMY
FROM CUSTOMER
WHERE CUSTOMERID = 1234567894
UNION
Select
SESSIONID, CUSTOMERNAME, CUSTOMERID, CUSTOMERDOB, 2 DUMMY
FROM CUSTOMER
ORDER BY DUMMY, CUSTOMERDOB ASC