Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Wed Feb 23, 2005 6:20 am
this would be right, right?
Code: Select all
$sql = "SELECT COUNT(t1.*) as t1Count, COUNT(t2.*) as t2Count FROM table1 t1, table2 t2";
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Feb 23, 2005 7:20 am
why not try it?
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Wed Feb 23, 2005 7:44 pm
uhm... I was asking if it would work? Can you do multiple counts like that? I haven't seen it done anywhere so i was curious. And i'm not at a computer or place that i can try it...
smpdawg
Forum Contributor
Posts: 292 Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:
Post
by smpdawg » Thu Feb 24, 2005 1:29 am
No.
timvw
DevNet Master
Posts: 4897 Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium
Post
by timvw » Thu Feb 24, 2005 8:27 am
for Illusionist:
meaby you should read (and try to understand) a decent introduction to sql first... and then you can start wondering how much sense it makes....
hint: count is a set-function.