Is it possible to run in the same sql 2000 query a union all and group by statement
what I am doing is creating a view from 4 different tables which hold a siteid in them.
then i want to get a unique list of them but dont really want to do this in 2 views
create view zAllSiteid
select call_siteid as siteid from tbl_calls
union all
select inventory_siteid as siteid from tbl_inventory
union all
select orders_siteid as siteid from tbl_Orders
then I would do a
select siteid from zAllSite
group by siteid
order by siteid
can i do this in one query?
Microsoft SQL Server 2005
Last Comment
Chris Michalczuk
8/22/2022 - Mon
Pratima
try this
Select x.siteid from(
select siteid from zAllSite
group by siteid ) x
Select x.siteid from(
select siteid from zAllSite
group by siteid ) x
order by x.siteid