MySQL Forums :: PHP :: Highest interval between two date same table


Advanced Search

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

Hi,

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,
Gerard



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

Options: ReplyQuote


Subject Written By Posted
Highest interval between two date same table Antonio Catano 03/01/2011 08:00AM
Re: Highest interval between two date same table Rick James 03/05/2011 04:06PM


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.