关联查询

join:
select a.serverid,c.serverip,a.filename,b.callernumber,b.callednumber,b.createtime,b.releasetime
from dbo.AGENTRECFILE as a
inner join dbo.COLOG as b
on a.coid=b.coid
inner join dbo.DEVICECFG as c
on a.serverid=c.serverid
where b.callernumber='xxx' or b.callednumber='xxx'
order by b.createtime asc

other:
select a.serverid,c.serverip,a.filename,b.callernumber,b.callednumber,b.createtime,b.releasetime
from dbo.AGENTRECFILE a, dbo.COLOG b, dbo.DEVICECFG c
where a.coid=b.coid and a.serverid=c.serverid and (b.callernumber='xxx' or b.callednumber='xxx')
order by b.createtime asc

你可能感兴趣的:(关联查询)