I need to select from a single table where both id exists in the column having matching id in another column. My query is like below which gives rows with even just single matching id.
select * from customer_appdata where appdata_id in(11,12)
id customer_id appdata_id
6 65 4
7 65 12
8 65 8
9 66 11
10 66 12
so here i just want last and second last rows(9,10) as they have both 11 and 12 with common id 66.