Oracle联表查询语句用法
SELECT *
FROM (SELECT R.*, s.StoreName, f.FactoryName, d.DepartmentName, rownum r
FROM Resources R, Store s, Factory f, Department d
WHERE rownum <= 6
AND R.resourcename = '大容积水箱'
and R.RESOURCESTORE = s.storeid
and R.RESOURCEFACTORY=f.factoryid
and R.RESOURCEBELONGTODEPT=d.departmentid)
WHERE r > 0
FROM (SELECT R.*, s.StoreName, f.FactoryName, d.DepartmentName, rownum r
FROM Resources R, Store s, Factory f, Department d
WHERE rownum <= 6
AND R.resourcename = '大容积水箱'
and R.RESOURCESTORE = s.storeid
and R.RESOURCEFACTORY=f.factoryid
and R.RESOURCEBELONGTODEPT=d.departmentid)
WHERE r > 0