在sql server里可以这么写
select * from a where b_id where (select id from b)
找出a.b_id包含于b.id的a里的记录,但到了my sql里,就不支持了。我对mysql不怎么懂,有没有高手指点下路子,感激涕零!
select * from a where b_id where (select id from b)
找出a.b_id包含于b.id的a里的记录,但到了my sql里,就不支持了。我对mysql不怎么懂,有没有高手指点下路子,感激涕零!
select * from a where b_id in (select id from b) ?
有继续回答的吗?感激涕零!
这是正确的啊
select * from company where id in (select id from company)都报SQL语句错
我这里测试通过,不知道你那为什么报错select * from company where id in (select id from company)
也是正确的你看看你那里select * from a报错不
会不会是mysql版本低不支持呢?我用的是虚拟主机上的MySQL 4.0.14
我是通过url传递SQL,多条的话不方便
select distinct Atable.* from a Atable, b Btable where Atable.b_id = Btable.id