[SOLVED] problem with sum() funtion

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

[SOLVED] problem with sum() funtion

Post by pelegk2 »

i am doing
SELECT SUM('val') as xx from mydata
where val is of type float
even when i do this on mySql i get 0 as the total value!!!!
why?
(i dont have negative numbers
thanks in advance
peleg
?>
User avatar
oQEDo
Forum Commoner
Posts: 43
Joined: Thu Feb 20, 2003 11:08 am
Location: UK

Post by oQEDo »

Try SELECT SUM(val) as xx from mydata (i.e. miss out the ' )
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

thanks it worked:)
Post Reply