Posted by cluthz on 06/14/07 14:56
I have a customer table and a customer_email_address table which are linked
as a customer can have multiple email addresses.
When I do a query that links the table, obviously it is possible that I
might get results with identical rows accept for the email_address field.
E.g.
select * from customer
Left join customer_email_address on (customer.id =
customer_email_address.cust_id)
As I want a list to show only one row for each customer of course I can use
groupby. Therefore adding
group by customer.id
But how do I know which row will be used when a customer has more then one
email address? Or to ask it another way, which email address will be
displayed.
Hopefully I have asked this question making it clear and simple as possible.
Thanks in advance.
[Back to original message]
|