Need to combine common result of two select statements

Posted by Anup on Stack Overflow See other posts from Stack Overflow or by Anup
Published on 2010-05-25T14:12:22Z Indexed on 2010/05/25 14:21 UTC
Read the original article Hit count: 335

Filed under:

i have to select the common coloumns c1 ,c2,c3 from result of two sql satements.

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

I need to select c1,c2,c3 all same and common found in both the result of query.

how could this be done...could anyone help please?

© Stack Overflow or respective owner

Related posts about sql