Friday, 15 April 2011

mysql - SQL - Get highest and lowest record -


I have a table with the event, each has a start and end date. Now I have the latest period date and event Want to get it with the earliest start date (only 1 SQL in PHP) Does anyone have to do this? Thanks!

If you want two rows instead of just two dates, then maybe union

  SELECT * from ORDER by end_data DESC serial 1 union select all * Start by ORDER * Data ASC limit 1    

No comments:

Post a Comment