按数量对另一个表中使用的行分类
我有2个表格和文档。 客户表的ID列与文档表中的CS_NO列相同,并且可以重复CS_NO。另外,在客户表中,我有一个名为as_ resident的列(值为y或n)。我需要查询是否具有IS_RESSIDEN VALUE N的客户有1个文档(如果CS_NO列中只写了一次客户ID) - “一个文档”,如果有2个或更多文档 - “某些文档”,则没有文件'。我不能加入
I have 2 tables- customers and documents.
Id column of customers table is same with the cs_no column in the documents table and cs_no can be repeated of course. Also in customers table, I have a column named as is_resident (values can be Y or N). I need to query if the customer with is_resident value N has 1 document(If customer id is written only once in cs_no column) - 'one document', if has 2 or more documents - 'some documents', if doesn't have 'no document'. I can't use join
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用相关的子问题:
Use a correlated sub-query: