I am joining a customer table to a phone number table based on customer_id. a customer can have many numbers, but i want only the primary one. however if there is not a primary one, i just want one of any of the others. this is what i have so far.
SELECT phon.number
FROM phones phon, customers cust
WHERE phon.customer_id (+)= cust.customer_id
AND phon.primary = 'Y';
any suggestions?
