Results 1 to 4 of 4

Thread: Cannot use alias in delete command

  1. #1
    Balbir Singh Guest

    Cannot use alias in delete command

    Why cannot I use alias in delete command when I join two table.

    My query is as follows.
    delete from ikw_indexed_form_approved where exists(select * from ikw_router
    where ikw_indexed_form_approved.ikw_subscription_id=ikw_ subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    if I use like this it gives me an error
    delete from ikw_indexed_form_approved A where exists(select * from ikw_router
    where A.ikw_subscription_id=ikw_subscription_id
    and A.ikw_indexed_name='centraal corp'
    and A.content_code='html'
    and A.ikw_subscription_id=1)

    Your help will be appreciated.
    Thanks in advance



  2. #2
    Gurinder Singh Kohli Guest

    Cannot use alias in delete command (reply)


    Hey Balbir

    Sat Sri Akal

    Try this.

    delete from ikw_indexed_form_approved
    from (select * from ikw_router) AS t1
    where ikw_indexed_form_approved.ikw_subscription_id=t1.i kw_subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    Let me know, if it worked or not.

    Thaxns.

    ------------
    Balbir Singh at 12/27/00 2:05:24 PM

    Why cannot I use alias in delete command when I join two table.

    My query is as follows.
    delete from ikw_indexed_form_approved where exists(select * from ikw_router
    where ikw_indexed_form_approved.ikw_subscription_id=ikw_ subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    if I use like this it gives me an error
    delete from ikw_indexed_form_approved A where exists(select * from ikw_router
    where A.ikw_subscription_id=ikw_subscription_id
    and A.ikw_indexed_name='centraal corp'
    and A.content_code='html'
    and A.ikw_subscription_id=1)

    Your help will be appreciated.
    Thanks in advance



  3. #3
    Balbir Singh Guest

    Cannot use alias in delete command (reply)

    Sat Sri Aakal.

    Actually, I want to use alias for ikw_indexed_form_approved table not for ikw_router table.
    I don't understand why in select statement we can use alias and in delete statment we can not.

    Thanks for your help.

    Bole so nehal, sat sri akal.

    If you are in America (California) then you can contact me
    Contact # 650 486 5520 (O)
    408 946 8382 (H)



    ------------
    Gurinder Singh Kohli at 12/27/00 6:07:22 PM


    Hey Balbir

    Sat Sri Akal

    Try this.

    delete from ikw_indexed_form_approved
    from (select * from ikw_router) AS t1
    where ikw_indexed_form_approved.ikw_subscription_id=t1.i kw_subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    Let me know, if it worked or not.

    Thaxns.

    ------------
    Balbir Singh at 12/27/00 2:05:24 PM

    Why cannot I use alias in delete command when I join two table.

    My query is as follows.
    delete from ikw_indexed_form_approved where exists(select * from ikw_router
    where ikw_indexed_form_approved.ikw_subscription_id=ikw_ subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    if I use like this it gives me an error
    delete from ikw_indexed_form_approved A where exists(select * from ikw_router
    where A.ikw_subscription_id=ikw_subscription_id
    and A.ikw_indexed_name='centraal corp'
    and A.content_code='html'
    and A.ikw_subscription_id=1)

    Your help will be appreciated.
    Thanks in advance



  4. #4
    michelle Guest

    Cannot use alias in delete command (reply)

    Try the following:

    delete a
    from ikw_indexed_form_approved as a
    where exists (select * from ikw_router
    where a.ikw_subscription_id=ikw_subscription_id)
    and a.ikw_indexed_name='centraal corp'
    and a.content_code='html'
    and a.ikw_subscription_id=1




    ------------
    Balbir Singh at 12/27/00 6:23:47 PM

    Sat Sri Aakal.

    Actually, I want to use alias for ikw_indexed_form_approved table not for ikw_router table.
    I don't understand why in select statement we can use alias and in delete statment we can not.

    Thanks for your help.

    Bole so nehal, sat sri akal.

    If you are in America (California) then you can contact me
    Contact # 650 486 5520 (O)
    408 946 8382 (H)



    ------------
    Gurinder Singh Kohli at 12/27/00 6:07:22 PM


    Hey Balbir

    Sat Sri Akal

    Try this.

    delete from ikw_indexed_form_approved
    from (select * from ikw_router) AS t1
    where ikw_indexed_form_approved.ikw_subscription_id=t1.i kw_subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    Let me know, if it worked or not.

    Thaxns.

    ------------
    Balbir Singh at 12/27/00 2:05:24 PM

    Why cannot I use alias in delete command when I join two table.

    My query is as follows.
    delete from ikw_indexed_form_approved where exists(select * from ikw_router
    where ikw_indexed_form_approved.ikw_subscription_id=ikw_ subscription_id
    and ikw_indexed_form_approved.ikw_indexed_name='ce ntraal corp'
    and ikw_indexed_form_approved.content_code='html&# 39;
    and ikw_indexed_form_approved.ikw_subscription_id=1)

    if I use like this it gives me an error
    delete from ikw_indexed_form_approved A where exists(select * from ikw_router
    where A.ikw_subscription_id=ikw_subscription_id
    and A.ikw_indexed_name='centraal corp'
    and A.content_code='html'
    and A.ikw_subscription_id=1)

    Your help will be appreciated.
    Thanks in advance



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •