sql语句没错,可出不来结果,帮我看看!
lmh79 2003-02-18 02:17:39 table1
id desc
1 a
2 b
table2
id t1id remark
1 1 大家好
2 1 恭喜
3 2 谢谢
4 2 解答
select *
from table1
where desc = 'a' or
exist (
select t1id from table2 where table1.id = table2.t1id and
table2.remark like '%a%'
)
我就是想把主表中某字段='a' 或者从表里面含'a'的主表记录找出来!以上sql语句有错误吗?