-
Picking Order data not for the year 2011
Hello
I have three tables
customer
Cust_id,Cust_nm
Product
Prod_id,Prod_Nm
Orders
Ord_id,Ord_dt,Cust_id,Prod_id
I want to pick up orders for years other than 2011
-
Join the three tables.
Include a predicate filtering out orders that belong to year 2011.
What do you have so far?
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
select c.cust_id,c.cust_id from customer c,order o
where c.cust_id=o.cust_id and o.ord_dt <'01-JAN-2011'
-
Originally Posted by dksuresh
select c.cust_id,c.cust_id from customer c,order o
where c.cust_id=o.cust_id and o.ord_dt <'01-JAN-2011'
Business specs asked to get "orders", I do not see any column coming form "order" table in the selected list of columns.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|