I have an SQL table with two columns Dateand Userand contains the following rows:
**Date User**
2009-02-20 Danny
2009-02-20 Matthew
2009-02-15 William
2009-02-15 Abner
2009-12-14 Joseph
1900-01-01 Adam
1900-01-01 Eve
Given the date, how do I write a WHERE clause to return a list of users for this date, or if no users were found for this date, return the list of users for the next earlier date. For example, if the specified date is " 2009-02-19 ", the list of users should be William and Abner .
source
share