MySQL Forums
Forum List  »  PHP

Highest interval between two date same table
Posted by: Antonio Catano
Date: March 01, 2011 08:00AM


I was searching a lot, and trying and trying again, I really don't know how to solve my problem, maybe because I don't know how SQL requirements works and treat tables. As sequence, or not.

Here is my problem. I have one table with a lot of columns. One of the column is date as example "2011-03-21". What I need is to order the date desc, and to compare first date with second and get the difference of days, then second with third and get difference of day...and so on. Finally I want to get the highest interval of day with the begin date and end date.

As adding to this problem, how can I select all dates and to have at the beginning my current date, today, then next closest date, and so on in desc order.

thank you for help,
Best regards,

Edited 1 time(s). Last edit at 03/01/2011 08:04AM by Antonio Catano.

Options: ReplyQuote

Written By
Highest interval between two date same table
March 01, 2011 08:00AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.