请问一个SQL查多个表的语法

[复制链接]
查看11 | 回复2 | 2009-9-3 07:31:15 | 显示全部楼层 |阅读模式
select a.id,a.uid,b.book,c.info from table1 a ,table2 b table3 c where a.id=b.id and a.id=c.idgroup by a.id,a.uid,b.book,c.info
回复

使用道具 举报

千问 | 2009-9-3 07:31:15 | 显示全部楼层
方法1: select * from table1 as a,table2 as b,table3 as c where a.id=b.id and b.id=c.id方法2:select * from table1 as a inner join table2 as b on a.id=b.id inner join table3 as c on b.id=c.id
回复

使用道具 举报

千问 | 2009-9-3 07:31:15 | 显示全部楼层
用视图勾一下就出来了,最简单
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行