OK, I have a perl script using mysql that pulls up a bunch of numbers
for a table. Problem is it's taking a long time because of the number of
select calls I'm making.
Basically, I have a sequence of calls of the form:
SELECT COUNT(*) FROM <table> WHERE <conditions>
(execute, get value of count, print out as cell item in table)
for each column in the row.
My question: Is there some way to consolidate all the calls in each
row into one select statment? Ie,
SELECT COUNT(*), COUNT(*), COUNT(*) FROM <table> WHERE <conditions#1>
<cond#2> <cond#3>
Then I'd do one call per row for a total of row queries, rather
than for rowXcolumns queries.
I'm thinking I might be able to do this with some form of aliasing,
but I'm kind of stumped on how to specify which set of conditions goes
to which count.
--Cindy
--
[EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php