查询组&子组 [英] query for group & sub group

查看:89
本文介绍了查询组&子组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在essess数据库中有一个表,下面是问题所在:
主代码主类型主名称专利代码
001 1各式各样的债务人a-1
002 1北德里001
003 1南德里001
004 1各式各样的债权人a-2
005 1西德里004
006 2阿米尔·钱德002
007 2 punam chand 003
008 2现金a-1
009 2 hans raj 005
010 2 ramesh 001


现在我想要一个查询,其中具有链接001和004及其子组的主类型2

请帮助我

i have a table in aceess database which coloums are below:
master code master type master name patent code
001 1 sundry debtors a-1
002 1 north delhi 001
003 1 south delhi 001
004 1 sundry creditors a-2
005 1 west delhi 004
006 2 amir chand 002
007 2 punam chand 003
008 2 cash a-1
009 2 hans raj 005
010 2 ramesh 001


now i want a query in which master type 2 with link 001 & 004 & their sub group

please help me

推荐答案

您可以使用group by来做到这一点,请阅读 ^ ].我确实认为您需要对不同的组名进行硬编码,并使用次优的联合.
You can use group by to do this, read here[^]. I do think you need to hard code the different group names and use union, which is sub optimal.


You can use group by to do this, read <a href="http://www.sqlservercentral.com/articles/Groouping/70023/">here</a>[<a href="http://www.sqlservercentral.com/articles/Groouping/70023/" target="_blank" title="New Window">^</a>].  I do think you need to hard code the different group names and use union, which is sub optimal.


这篇关于查询组&amp;子组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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