DELETE Statement
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: DELETE Statement

  1. #1
    Join Date
    Jan 2002
    Posts
    111

    DELETE Statement

    I have the below two Statements below the Count gives me a differrent value. Can any one help me.

    SELECT COUNT(*)
    FROM apps.oe_order_headers_all h,
    apps.oe_transaction_types_tl t,
    apps.oe_order_lines_all l
    WHERE h.header_id = l.header_id
    AND h.order_type_id = t.transaction_type_id
    AND h.order_category_code = 'RETURN'
    AND h.org_id = 183
    AND h.booked_flag = 'N'
    AND h.last_update_date < SYSDATE - 90
    AND h.sales_channel_code IN ('A','B','C','D','I')
    AND t.language = 'US'
    AND t.name LIKE 'RMA%'

    --94724

    SELECT COUNT(*) FROM apps.oe_order_headers_all h
    WHERE EXISTS ( SELECT 1
    FROM apps.oe_order_lines_all l,
    apps.oe_transaction_types_tl t
    WHERE h.header_id = l.header_id
    AND h.order_type_id = t.transaction_type_id
    AND h.order_category_code = 'RETURN'
    AND h.org_id = 183
    AND h.booked_flag = 'N'
    AND h.last_update_date < SYSDATE - 90
    AND h.sales_channel_code IN ('A','B','C','D','I')
    AND t.language = 'US'
    AND t.name LIKE 'RMA%')
    --1466

    The second i will be replacing a delete instead of COUNT(*).

    Please help

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,477

    Cool Better someone else do it...

    Maybe you should leave the DELETE to someone else with more experience.

    It appears you yourself do not know the difference between the statements you wrote!!!

    Maybe it's time you re-visited SQL 101.
    .
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

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



Click Here to Expand Forum to Full Width