Jump to content

Mysql Select Date Selection


ProblemHelpPlease

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...