Pls help me

  • 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

  • you're telling the server to do this, which is impossible :

    update set colum = (SELECT col1, col2, ... FROM )

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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?

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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