码迷,mamicode.com
首页 > 数据库 > 详细

sql筛选查询A表中B表已经存在的数据

时间:2016-07-29 19:00:38      阅读:879      评论:0      收藏:0      [点我收藏+]

标签:

SELECT *
FROM A LEFT OUTER JOIN
B ON A.ID = B.ID
WHERE B.ID IS NULL

 

开发实例:

SELECT Position_Car.Area, Position_Car.CarMapNum, Position_Car.CheweiID, Position_Car.CarlotName,
Position_Car.Points
FROM Position_Car LEFT OUTER JOIN
TRelation_Equipment_Position ON TRelation_Equipment_Position.CheWeiID = Position_Car.CheweiID
WHERE (Position_Car.CarMapNum = @CarMapNum) AND (TRelation_Equipment_Position.CheWeiID IS NULL)

sql筛选查询A表中B表已经存在的数据

标签:

原文地址:http://www.cnblogs.com/tuhong/p/5719090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!