How do i get the earliest date and latest date from 5differnt table in sql and populate them into a dropdown form?
i want to create a "generate report" page which 开发者_开发知识库shows me statisc regarding what happen within a range of time. How do i get the oldest date from 5 tables and newer date from 5table and populate each different date into 2 dropdown list?
The 5 table are the same.
1 with all the oldest date , and 2 with all the newer date. User can then choose what is the range they required and thus POST the data back to the same page and do a query run with the post?
Thanks alot for the help.
This will most likely be a combination of a "MIN" function and a "UNION" operation
SELECT MIN(SOMEDATE) FROM TABLE1
UNION SELECT MIN(SOMEDATE) FROM TABLE2
UNION SELECT MIN(SOMEDATE) FROM TABLE3
...
精彩评论