In the last episode (Nov 24), Steffan A. Cline said:
> Is there anything I am missing that will allow me to return a default row if
> the sought after row is not found?
> 
> For example :
> 
> Select * from table1 where column1=1234
> 
> If 1234 is not found, row1 would be returned instead.
> If 1234 is found then that is the row returned.

SELECT * FROM (
 SELECT * FROM table1 WHERE column1=1234
  UNION
 SELECT * FROM table1 WHERE column1=1 /* or whatever uniquely identifies row1 */
) t LIMIT 1;

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to