View Single Post
Old 10-09-2012, 08:46 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Code:
SELECT MIN( IF(status=1,online,'2099-12-31') ) AS minStatus1,
       MAX( IF(status=2,online,'1900-1-1') ) AS maxStatus2
FROM table
Naturally, the "dummy" values there (2099-12-31 and 1900-1-1) can be anything you choose that are outside the possible range of value in your actual data.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote