id name source
-----------------
1 'n' 'a'
1 'n' 'b'
1 'n' 'c'
1 'n' 'd'
2 'n' 'a'
2 'n' 'c'
がどのように私は(ソース== ||ソース== F)& &(ソースが含まれているすべてのIDを選択することができます== c || source == g)?
このMySQL用です...
id name source
-----------------
1 'n' 'a'
1 'n' 'b'
1 'n' 'c'
1 'n' 'd'
2 'n' 'a'
2 'n' 'c'
がどのように私は(ソース== ||ソース== F)& &(ソースが含まれているすべてのIDを選択することができます== c || source == g)?
このMySQL用です...
select unique id from table as t1
where (t1.source = 'a' or t1.source='f')
and exists
(select * from table as t2
where t2.id = t1.id and (t2.source = 'c' or t2.source='g')
)
あなたは何を試してみましたか?それは助けるためにここにあります、そうでなければ、あなたはrent-a-coder.comを望みます。 –