我用这个语句查询 出所有车辆 select 车组,a.[车牌号码],d.备注 as 操作记录备注 from 总表 as a left JOIN 自己卡 as b on a.[车牌号码]=b.[车牌号码] left join 续费 as c on a.[车牌号码]=c.[车牌号码] left join 操作记录 as d on a.[车牌号码]=d.[车牌号码]
我想要的结果是不包含欠费和转出的车辆 应该如何编写 谢谢 我语句后面加入 where 备注 not in ('欠费','转出') 查询出来只有个别写了操作备注的车辆 麻烦大家了谢谢
SELECT
车组,
a.车牌号码,
d.备注 AS 操作记录备注
FROM
总表 AS a
LEFT JOIN
自己卡 AS b
ON
a.[车牌号码]=b.[车牌号码]
LEFT JOIN
续费 AS c
ON
a.[车牌号码]=c.[车牌号码]
LEFT JOIN
操作记录 AS d
ON
a.[车牌号码]=d.[车牌号码]
where d.备注 not in ('欠费','转出')