Welcome to Sign in | Help

Select >> Update - SQL Server 2005

  •  01-22-2009, 11:27 AM

    Select >> Update - SQL Server 2005

    salut, am selectul urmator

    select B.CodContract from LBF B
    where B.DataReferinta='12/31/2008' and B.TipCredit=0
    and B.ValoareContract != (select sum(PrincipalPlatit+PrincipalRestant-AmendamentPrincipal)
          from LBF 
          where DataReferinta='12/31/2008' and TipCredit=0 and CodContract=B.CodContract and NodId=B.NodId
          group by CodContract)
    group by B.CodContract

    pot face un update pe tabela astfel incat  conditia

    B.ValoareContract != (select sum(PrincipalPlatit+PrincipalRestant-AmendamentPrincipal)
          from LBF 
          where DataReferinta='12/31/2008' and TipCredit=0 and CodContract=B.CodContract and NodId=B.NodId
          group by CodContract)


    sa fie satisfacuta, selectul acesta sa nu-mi returneze nimic, ma tot chinui dar nu-mi iese ma incurca rau ultimul group by.

    multumesc.

    alex.

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems