三表联合查询视图
A表
ID Name Size
B表
ID Quantity
C表
ID XX YY ZZ
根据三个表ID一致来查询,请问该怎么编写视图?
[解决办法]
create view xxxx
as
select a.*,b.quantity,c.xx,c.yy,c.zz
from a inner join b on a.id=b.id inner join c on a.id=c.id
where xxxx
[解决办法]
create view vie_test
as
select a.name,a.size,b.Quantity,xx,yy,zz
from a
left join b on a.id=b.id
left join c on a.id=c.id
where c.xx>100