c# - Combine Multiple Select Statements from different tables -


i have mysql sp sum against different tables wanted sp return results in 1 table 1 row tried using + combine results selects gets error

 drop procedure if exists x.getfinancecontent;  delimiter //  create procedure x.getfinancecontent     (          in  userid int      )  begin  (select sum(amount) credittotal     x.card1      user_id = userid , card_type=1)      +   (select sum(amount) debittotal     x.card2      user_id = userid , card_type=2)     end;// 

error code: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '+ (select sum(amount) debittotal x.card user_id ' @ line 10 0.000 sec

select      ( select sum(amount) credittotal       x.card1       user_id = userid , card_type=1     )     , ( select sum(amount) debittotal       x.card2       user_id = userid , card_type=2     )  

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -