October 6, 2011 at 6:10 am
UPDATE TR_REC SET LMTD_TRCDMA = (SELECT C.CRT_Cod,
sum (case when R.Prod_Typ in ('Mobile','Hello','Rdel','Data','HSD') then MRP Else 0 End)/100000
from TR_REC C inner Join ER_Main E on C.CRT_Cod=E.CRT_Cod inner Join Rch_Vouchsep11 R on E.ER_MDN=R.Donor_MDN
where C.Clstr_Nm in ('Bengaluru B','Bengaluru W') and Day (Tran_dt) < Day(GetDate()) And C.CH_typ in ('CDIST','DIST','ROR','Modern')
Group By C.CRT_Cod)
Where LMTD_TRCDMA = Null
------------------------------------
Error Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thanks & Regards
Sabari
October 6, 2011 at 6:23 am
you're telling the server to do this, which is impossible :
update set colum = (SELECT col1, col2, ... FROM )
October 6, 2011 at 6:23 am
i think the issue is this:
SET LMTD_TRCDMA = (SELECT C.CRT_Cod,
SUM (CASE
WHEN R.Prod_Typ IN ( 'Mobile', 'Hello', 'Rdel', 'Data', 'HSD' )
THEN MRP
ELSE 0
END) / 100000
what value did you want to set LMTD_TRCDMA to?
inside the select are two columns, C.CRT_Cod and that SUM() statement...you can only assign one of those columns to LMTD_TRCDMA
Lowell
October 6, 2011 at 6:24 am
Ninja's_RGR'us (10/6/2011)
you're telling the server to do this, which is impossible :update set colum = (SELECT col1, col2, ... FROM )
sigh...Ninja'd again...well deserved nickname, for sure.
Lowell
October 6, 2011 at 6:25 am
Lowell (10/6/2011)
Ninja's_RGR'us (10/6/2011)
you're telling the server to do this, which is impossible :update set colum = (SELECT col1, col2, ... FROM )
sigh...Ninja'd again...well deserved nickname, for sure.
Well you guys gave it to me for a reason ;-).
Remember what RgRus stands for?
October 6, 2011 at 6:32 am
Ninja's_RGR'us (10/6/2011)
Lowell (10/6/2011)
Ninja's_RGR'us (10/6/2011)
you're telling the server to do this, which is impossible :update set colum = (SELECT col1, col2, ... FROM )
sigh...Ninja'd again...well deserved nickname, for sure.
Well you guys gave it to me for a reason ;-).
Remember what RgRus stands for?
can't seem to rememrber it,and my Google-Fu failed me when searching the site for the phrase...what does it stand for, Remi?
Lowell
October 6, 2011 at 6:38 am
It's a double word play. RG => Remi Gregoire
Rus for like toys r us.
Sushila had originally come up with this much better meaning => Resident Genius / Ubiquitous Spook
Then just put the extra R in there for the word play and because it's the most dominant letter in my name(s).
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply