Results 1 to 1 of 1

Thread: Rewriting QUery

  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unhappy Unanswered: Need Help Rewriting QUery

    My problem is that I have to rewrite the following query using COUNT and GROUP BY and get the same results. The Query lists the name of customers in a database such that all parts they buy are made by suppliers in "Germany"
    the query goes as:
    SELECT C_NAME
    FROM CUSTOMER
    WHERE NOT EXISTS (SELECT L_PARTKEY
    FROM ORDER LINEITEM PARTSUPP SUPPLIER
    WHERE O_CUSTKEY = C_CUSTKEY
    AND O_ORDERKEY = L_ORDERKEY
    AND L_PARTKEY = PS_PARTKEY
    AND PS_SUPKEY = S_SUPKEY
    AND S_NATIONKEY NOT IN (SELECT N_NATIONKEY
    FROM NATION
    WHERE _NAME = ``GERMANY''))

    please any help how to rewrite the above using COUNT and GROUP BY will VERYVERY appreciate Thanks
    Last edited by ppapas_98; 04-27-04 at 13:35.

Posting Permissions

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