
September 23rd, 2011, 10:28 AM
|
 |
Contributing User
|
|
Join Date: Mar 2003
Posts: 360
Time spent in forums: 1 Day 18 h 54 m 13 sec
Reputation Power: 11
|
|
|
Select specific id or first id
I need to select a specific ID but if it dose not exist then get the first id in the column. I'm not a DBA but i've tried various combos but cant get this to work.
Code:
select ID from OFFER where id='100002' or min(ID);
select ID from OFFER where id='100002' or (select min(ID) from OFFER );
Last edited by PHPme : September 23rd, 2011 at 10:44 AM.
|