ProblemHelpPlease Posted October 27, 2009 Share Posted October 27, 2009 I am trying to select the 31 most recent dates from a database, the problem is that if the last date to be selected (the furthest back in time) is not the only entry with that the date then I either don't want to select it or I want to select the other dates that match it as well(depending on which is easier).Any ideas? Link to comment Share on other sites More sharing options...
dor Posted October 31, 2009 Share Posted October 31, 2009 you may select 31+1 records (32 records...) and see if the #32 record's date matches the #31 record's date.If so (there's a match), remove the last 2 records. Otherwise remove only the last record.Though a solution with a @rownum variable and an IF clause may be valid too. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.