This is a reall simple SQL question

This is a reall simple SQL question

am 24.01.2006 19:01:18 von furby

I have a table with the structure of something like this :
Username Varchar 255
Price Decimal 10,2

I want to use a select query to retrieve the total of all the price
fields for a specific user.

I tried:
"Select sum(price) as total from orders where username = 'XXX'"
Which works in other Databases I've used, but MySQL belches the query
back at me and tells me that it doesn't work.

How do I do this?

Re: This is a reall simple SQL question

am 24.01.2006 19:50:02 von Bill Karwin

"furby" wrote in message
news:1138122897.281356.45130@g14g2000cwa.googlegroups.com...
> "Select sum(price) as total from orders where username = 'XXX'"
> Which works in other Databases I've used, but MySQL belches the query
> back at me and tells me that it doesn't work.

That looks all right to me. What exact error message do you see?

What version of MySQL are you using? What server operating system?

Is that the whole SQL query you are executing, or is it part of a subquery?

Regards,
Bill K.