如何在另一个值下的一个值的SQL查询中执行 [英] How Do I Do In Sql Query Of One Value Under Another Value
本文介绍了如何在另一个值下的一个值的SQL查询中执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如: - 如果我有名字='Amit',那么amit没有要显示的子类别/下属。
如果name ='Sumit'有子类别/下属要显示
LIKE: - Amit -1st表值来了
Sumit -1st表值来了
--Abeer -2nd表值来
--Ajai -2nd表值来了
i希望在sql查询中显示这样或者我在asp.net中使用哪个循环 - > ;我怎么算不。 of tikmes相同的值来自数据库存储过程
ex:- if i have name = 'Amit' then amit has no subcategory/subordinates to show.
if name='Sumit' has subcategory/subordinates to show
LIKE :- Amit -1st table values comes
Sumit -1st table values comes
--Abeer -2nd table values comes
--Ajai -2nd table values comes
i want to show like this in sql query or which loop i use in asp.net -> how i count no. of tikmes the same values comes from database stored procedure
推荐答案
如果我正确理解您的问题,您可以使用公用表表达式使用递归SQL查询。查看使用公用表表达式的递归查询 [ ^ ]
If I understand your question correctly, you can use a recursive SQL query using Common Table Expressions. Have a look at Recursive Queries Using Common Table Expressions[^]
@mika就像ABCD - >在行中
然后A C
B D
喜欢这个
@mika it's like A B C D - > in row
then A C
B D
like this
这篇关于如何在另一个值下的一个值的SQL查询中执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文