同意楼上的或者 select aaa from tableName where bbb in ('f','s')
select aaa from TABLENAME where bbb = 'f' AND bbb = 's'
请问你有没有把aaa和bbb关联起来?用哪个字段作为关联的? 如果有就很好办了。 //假设aaa表中的f_bbb字段和bbb表中的f_hello字段(其中f_hello字段放的值为:f,c,s) select aaa.* from aaa,bbb where aaa.f_bbb=bbb.f_hello and (bbb.f_hello=s or bbb.f_hello=f) 不知道这样符不符合你的要求。//呵呵
搞错了。不好意思!!! 还以为是aaa,bbb两个表。
select aaa from TABLENAME where bbb = 'f' AND bbb = 's'这句话能返回结果?
试试这个看,应该是你要的select t1.aaa from TABLENAME t1, TABLENAME t2 where t1.aaa = t2.aaa and t1.bbb='s' and t2.bbb='f';
select aaa from tablename where aaa in (select aaa from table where bbb='s') and bbb='f';
select aaa from tablename where aaa in (select aaa from tablename where bbb='s') and bbb='f';
如果有就很好办了。
//假设aaa表中的f_bbb字段和bbb表中的f_hello字段(其中f_hello字段放的值为:f,c,s)
select aaa.* from aaa,bbb where aaa.f_bbb=bbb.f_hello and (bbb.f_hello=s or bbb.f_hello=f)
不知道这样符不符合你的要求。//呵呵
还以为是aaa,bbb两个表。
where t1.aaa = t2.aaa and
t1.bbb='s' and t2.bbb='f';