Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2009
    Posts
    1

    Unanswered: Deletion with LIKE

    Anyone knws how to amend this query doesnt check that HseName in Table t1 is not in Table t2 & t3 before deletion.

    Table Details:
    t1
    HseName
    ------------
    Grace House

    t2 & t3
    HseName
    ------------
    Evergreen/London/Grace House

    Code:
    Delete a from t1 a left join t2 b on b.HseName LIKE '%'+a.HseName+'%'
    left join t3 c on c.HseName LIKE '%'+a.HseName+'%'
    where a.HseName='Grace House' and b.HseName is null and c.HseName is Null
    Last edited by laalaa; 07-01-09 at 08:13.

Posting Permissions

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