2012-03-17 56 views
0

這是我的查詢我的SQL UNION +極限

select PhoneNumber as _data,PhoneType as _type from contact_phonenumbers where ContactID = 3 and Type = 'R' and PT = 'M' 
union 
SELECT EmailID,Type from contact_emails where ContactID = 3 and Type = 'P' 
UNION 
SELECT EmailID,Type from contact_emails where ContactID = 3 and Type = 'O' 

這裏我的問題是我需要從每個SELECT語句只獲取一行。是否有可能通過「限制」來獲取它。請幫助

+0

你甚至嘗試? – MatBailie 2012-03-17 10:17:33

回答