Jump to content

Mysql Select Date Selection


ProblemHelpPlease
 Share

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.

Edited by Dor
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...