DColin
asked on
SQL query.
Hi Experts,
I want to select all customer names from a table that share the highest ID. The following sql shows what I want to do but does not work.
SELECT CustomerName FROM tblCustomers WHERE ID = MAX(ID)
I want to select all customer names from a table that share the highest ID. The following sql shows what I want to do but does not work.
SELECT CustomerName FROM tblCustomers WHERE ID = MAX(ID)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT Max([ID]) from tblCustomers
would only return a single ID value.
Can you describe (in words, not SQL) what it is you really want to accomplish?
You may have to provide a little more detail about your table structure. If you could provide a couple of sample records (sanitized to avoid revealing personal, financial, or proprietary information) , that would be even better.