How can i add 2 querys from a select statement
-
I have 2 select statements and both of them return a number, i need to add the result of both of them Does any one know HOW-TO do this... Glenn Guzman San Jose, Costa Rica
-
I have 2 select statements and both of them return a number, i need to add the result of both of them Does any one know HOW-TO do this... Glenn Guzman San Jose, Costa Rica
SELECT A.A+B.B
FROM (SELECT 1 as A) AS A
INNER JOIN (SELECT 2 as B) AS B ON 1=1For this to work each subquery (the selects inside the brackets) must return exactly one row only.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
-
I have 2 select statements and both of them return a number, i need to add the result of both of them Does any one know HOW-TO do this... Glenn Guzman San Jose, Costa Rica
U can try something like create view vwtest as select A.X S from Table A where union select B.X S from Table B where select sum(S) from vwtest cool man