#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    364
    Rep Power
    12

    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.

IMN logo majestic logo threadwatch logo seochat tools logo