hello guys,
I have 25 different warehouse table and all of them has same fields and data. I built a query for with other tables using only 1 warehouse table and want to append all warehouse.
Below is the example. This is one way of append all data but my query would be more 20 pages. what is best approach ? I dont know much about loops , can we use loop instead. Thanks in advance.
Select ponum, ............. from potble t1
inner join warehouse tbl1 t2 on t1.ponum=t2.ponum
union all
Select ponum, ............. from potble t1
inner join warehouse tbl2 t2 on t1.ponum=t2.ponum
Union all
Select ponum, ............. from potble t1
inner join warehouse tbl3 t2 on t1.ponum=t2.ponum
.
.
.
.
.
.
.
.