开发者

How do i get the earliest date and latest date from 5differnt table in sql and populate them into a dropdown form?

开发者 https://www.devze.com 2023-03-24 03:23 出处:网络
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

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

...

0

精彩评论

暂无评论...
验证码 换一张
取 消