Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining multiple queries

Status
Not open for further replies.

xtreemnet

Programmer
Joined
Aug 9, 2003
Messages
88
Location
NZ
Hi,

How do I combine multiple queries as below into one row?

Select count(a) as cnta from s;
Select count(b) as cntb from t;

Display them as one row as:
count(a), count(b)

Thanks,
 
I have found the solution. I can use it as below:

Select (Select count(a) as cnta from s) as ca,
(Select count(b) as cntb from t) as cb

The out looks as:

ca cb
23 45
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top