select * from tableA where id=tableB.id

来源:百度知道 编辑:UC知道 时间:2024/06/05 07:20:07
这么写对吗, from后面没有tableb where 后面可以有tableB吗?我看网上说可以但是我自己试了下怎么不可以呀

不可以,不知道你从哪找到。这段代码连二把刀都算不上。

select * from tableA,tableB where tableA.id=tableB.id

这回楼主再试试

首先你得让我们 明白,你到底想要做什么?才能知道 语句怎么写
select*from tableA.tableB where tableA.id=tableB.id
这样写属于 内连接,不知道是不是你的意思
希望对你又帮助

select tableA.* from tableA,tableB where tableA.id=tableB.id

如果表名太长,可以这么写
select A.* from tableA A,tableB B where A.id=B.id

不可以,tableB也一定要出现在from 之后

xuexi