我必須從兩個sql語句的結果中選擇常見coloumns c1,c2,c3。需要結合兩條select語句的常見結果
1)
select c1, c2, c3,count(c3) from (select * from form_name
where data_created >'1273446000' and data_creazione<'1274569200')
group by c1,c2, c3 having count(c3)>1
2)
select c1, c2, c3,count(c3) from (select * from form_name
where data_created>'1272236400' and data_creazione<'1274569200')
group by c1,c2, c3 having count(c3)>2
,我需要選擇C1,C2,C3都相同,常見的查詢兩種結果發現。
這怎麼可能完成......任何人都可以幫忙嗎?
你可以使用UNION來合併這兩個查詢到一個 – MUG4N 2010-05-25 14:17:41