tags:

views:

20

answers:

1

Hello! Is there a way to get a records in single query based on two conditions and second condition must be cheked only if first one failed. For example how can I get all records where time > NOW() and if there are no such records to get a record with max(id).

+1  A: 

http://dev.mysql.com/doc/refman/5.0/en/case-statement.html

yoda
Still don't get it. Do I need to create procedure for this?
Konstantin