Delete from Table syntax

  • delete from POL_COV_RATE_DTL_V C1

    where C1.ROW_ACTIVE_STS_D = 9999999

    and C1.UNITCOVERAGE_ID in

    ( select B.UNITCOVERAGE_ID

    from POL_UNITCOVERAGE B

    where B.UNITCOMMON_ID

    in

    (select A.UNITCOMMON_ID

    from POL_UNITCOMMON A

    where A.POLICY_ID = 1 )

    )

    can any one tell me what is the wrong with this sql ??

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near 'C1'.

    this is the error message I am getting.

    Thanks in advance

  • I would delete C1..

    delete from POL_COV_RATE_DTL_V

    where

    ROW_ACTIVE_STS_D = 9999999 and UNITCOVERAGE_ID in

    ( select B.UNITCOVERAGE_ID

    from POL_UNITCOVERAGE B

    where B.UNITCOMMON_ID

    in

    (select A.UNITCOMMON_ID

    from POL_UNITCOMMON A

    where A.POLICY_ID = 1 )

    )

  • Hi,

    I am not sure why you are getting this error... But your delete statement will work even without aliasing. So I think you can fire your delete statement by removing the aliases till some expert answer your question.

  • Hi Jonathan..

    Thanks for the reply. The same syntax is working fine with SQL-92 (UDB syntax) , what's wrong with alias table in delete ??

  • I guess it's not neccesary..

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply