sql - Sort out the three first occurence of an attribute -


I am starting in MyScall but I am creating a calendar application, where I have a database of future event positions The features in the event post are: ID, title, start-up, endtime, start date, repeat. Where the previous feature is repeated, it is that if the event post is not started by weekly, monthly or start-up.

I have to solve an event post from a SQL-query where there are only three first dates in the database starting today? Example If we have event posts for dated 14, 16, 19 in databases, there are dates to show with related event posts. Three days before three dates will not be displayed.

Pls HELP ME

To get events for the next three non sequential days For, start from today:

  SELECT x. * From (SELECT ep. *, Case DATE (@dt) = DATE (x .dt) then @Rownum ELSE @Rownum: = @rownum + 1 END As the rank, join the EVENT_POST part (SELECT @rowrum: = 0 , @dt: = NULL) where ep.startdate> = cURRENT_DATE by order T startad, T starttime) x where xreak and lt; = 3  

To get events for the next three sequential days, start from today:

  SELECT ep. * From EVENT_POST ep where date (now) and DATE_ADD (DATE (NOW), INTERVAL 3 days) between ep.startdate  

Comments