You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor
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