我怎么会失踪记录..... [英] How I Do Get Missing Record.....

查看:67
本文介绍了我怎么会失踪记录.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此查询获取缺失记录





I Using this Query Get Missing Record


Select ServiceId, ClassId from  ServiceMaster, ClassMaster
Where Not Exists(Select ServiceId, ClassId from ServiceRateMaster where ServiceId =(Select ServiceId from ServiceMaster) and ClassId = (Select ClassId from ClassMaster  ))
Order By ServiceId ,ClassId





但从SQl获取此错误









But Getting This Error from SQl



Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

推荐答案

你的代码应该在子查询中的运算符中



Your code should have in operator in subqueries

Select ServiceId, ClassId from  ServiceMaster, ClassMaster
Where Not Exists(Select ServiceId, ClassId from ServiceRateMaster where ServiceId In(Select ServiceId from ServiceMaster) and ClassId in (Select ClassId from ClassMaster))
Order By ServiceId ,ClassId


这篇关于我怎么会失踪记录.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆