SELECT
SUM(contramount) 'Bekommen' as total
FROM sam_date_val
WHERE projnr BETWEEN '1000' AND '5000'
UNION
SUM(tovalue) 'Genommen' as total
FROM
sam_date_val
Use the UNION function to join them together.
Notes:
1. UNION is only available on MySQL 4.1 and above.
2. The two (or more) selects in the UNION must return exactly the same number of fields.
3. I've added " as total" after each SUM(). This aliases the result to an easy to use name.
Thanks for the answer - but i DONT WANT a sigle data - sry i think i didnt say that.
I want to have many SUMs and then i want to put them into an Array!!!
Ithink this command cant be put in an Array!!!