0

Unions!!!

Why would anyone in create a DB where the table names are separated by month? (Sessions_month_1) thru (Sessions_month_12) I have to make a giant Union query is there a way to trim the code down?

8th Jul 2016, 11:30 PM
Paul J Medina Jr
Paul J Medina Jr - avatar
1 Answer
+ 1
Ask the designer who created it, he will explain you the reason. As far as query is concerned, you have no other option. I would suggest, create a stored procedure which creates a temporary table and inserts all the records using union command. Then from that temporary table it will be easy to access data. Also you will have the SP all time to run easily without having long union query each time.
12th Jul 2016, 9:27 AM
Ashutosh Singh