I have two tables 1:n relationship, customer to orders the schema is in the
http://sqlfiddle.com/#!9/a6842e/1 I have created.
The key in customer is composite
type. I am trying to get the email address from the customer table where the
order_id is = 2
So the query is:
SELECT email FROM customer c, orders o WHERE o.custId = c.id AND o.id = 2
This is returning two rows even though I specified
o.id = 2
Here's a fiddle
How to get just the email where
o.id = 2 and that rows
foreign key = primary key of
Any help appreciated.