var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: query problem
Could someone help me with this
I want to combine the following 2 queries into 1 query where it would give me 2 results (proflad and proftot) but don't know how
select sum(return-inv)as proflad
from allbets where com="lad"
select sum(return-inv)as proftot
from allbets where com="tot"
This should work:
(select sum(return-inv) from allbets where com="lad") as proflad
, (select sum(return-inv) from allbets where com="tot") as proftot
I tried that but I still get an error message
Error: You have an error in your SQL syntax..............
Any other ideas?
version of mysql
I believe that sub selects are supported from 4.1 and higher, so check your version.
I have version 4.0.16
Is there any way I can run this query with this?
The only other thing I can think of would be something like:
but the results will be returned as two separate rows (rather than one row in two columns).
sum(return_inv) as return_inv, com
where com="lad" OR com="tot"
group by com