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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Count(*) in one query

Status
Not open for further replies.

JohnyHooker

Programmer
Dec 11, 2001
3
CZ
I need to SELECT about five Count(*)s in one query - something like

SELECT Count(*) FROM table1, Count(*) FROM table2; etc.

Anybody knows how to do this ??
Thanks much, Hooker
 
select count(*) as tabel2_cnt, "table1_cnt" = (select count(*) from table1 )
from table2

 
The following works without creating a certesian join of table A/B/C/etc...

Select 'Table A' as table_name,
count(*)
From Table_A
UNION ALL
Select 'Table B' as table_name,
count(*)
From Table_B
UNION ALL
Select 'Table C' as table_name,
count(*)
From Table_C

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top