
September 17th, 2012, 09:47 PM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
|
easiest way is to retrieve a number of rows, say 20, sequenced by time descending
then as you process these in your application language (php or whatever), throw away the ones you don't want
if you still haven't reached your quota of 3, go get another 20 and lather, rinse, repeat
trust me, it's a lot easier and more efficient doing it this way than attempting to do that complex filtering with sql
|