select c.cabName,r.motorName ,
(
select
p.poolName
from
NodeInfo n,PoolInfo p,Pool_node pn
where
n.nodeID = ?
and
p.poolID=pn.poolID
and
pn.nodeID =n.nodeID
)
as
poolName, n.* from NodeInfo n,CabinetInfo c, MotorRoomInfo r
where
n.nodeID = 6 and n.cabinetID =c.cabinetID and c.roomID = r.roomID;
...全文
782打赏收藏
这个sql如何优化?
select c.cabName,r.motorName , ( select p.poolName from NodeInfo n,PoolInfo p,Pool_node pn where n.nodeID = ? and p.poolID=pn.poolID and pn.nodeID =n.nodeID ) as poolName, n.* from NodeInfo n,CabinetInfo c, MotorRoomInfo r where n.nodeID = 6 and n.ca