日期:2014-05-17 浏览次数:20507 次
SELECT a.node , a.nodename , a.chanid , b.isPTZ , c.dvrPort , o.OrgCode , d.id FROM B AS a LEFT JOIN B AS b ON a.chanId = b.ID LEFT JOIN C AS c ON b.DvrID = c.ID LEFT JOIN D o ON o.id = c.orgid LEFT JOIN E d ON d.vischanno = b.channo AND b.channo != '' AND b.channo IS NOT NULL WHERE a.chanGroupId IN ( 13673, 13674, 13887, 1376113 ) --这里如果有1000个以上,不如LZ再建立一张表(建好索引),用exists判断一下即可。 --chanGroupId 也建好索引即可。