On Thu, 5 Aug 2004 08:48:01 -0500, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
[snip]
A quickie for you:

How do I say
SELECT * FROM mytable where the sum of this field + this field + this
field < x

I can't say I've done one of those before.
[/snip]

How many SQL queries can a PHP list handle in a day? More than the MySQL
list! Hahahahahaha!

SELECT a + b + c and myTotal FROM myTable HAVING myTotal < x
[/snip]

Sorry, syntax errors....

SELECT a + b + c AS myTotal FROM myTable HAVING myTotal < x

you can also do this

SELECT (SUM(foo) + SUM(bar)) AS myTotal FROM myTable GROUP BY thisThing
HAVING myTotal < x

Just say

SELECT * FROM Table WHERE Table.a + Table.b + Table.c < x

That should work, and it will be faster than using a HAVING clause.

Brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to