mysql select help
am 09.09.2006 20:21:48 von KalviHi!
What wrong on this clause?
SELECT * from summad SUM(sum1+sum2+sum3) AS summa HAVING summa > sumall
Tx for help
Hi!
What wrong on this clause?
SELECT * from summad SUM(sum1+sum2+sum3) AS summa HAVING summa > sumall
Tx for help
Mikro wrote:
> Hi!
>
> What wrong on this clause?
>
> SELECT * from summad SUM(sum1+sum2+sum3) AS summa HAVING summa > sumall
>
> Tx for help
>
>
Do not know your table layout but you can not have a 'SUM' after the
FROM clause and before the 'HAVING' clause. You use the 'SUM' in either
your 'SELECT' statement or the 'Having' clause. Also you can not have a
'HAVING' clause without a 'GROUP BY' clause.
Look here:
http://www.techonthenet.com/sql/having.php
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Mikro wrote:
>
> What wrong on this clause?
>
> SELECT * from summad SUM(sum1+sum2+sum3)
> AS summa HAVING summa > sumall
Everything. You list a data item to select (summa) after a FROM clause
(it should be before). You also combine retrieving records with
retrieving aggregates from the same table, which doesn't make sense.
Cheers,
NC