Click here to Skip to main content
16,023,339 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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
Posted

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[^]
 
Share this answer
 
@mika it's like A B C D - > in row
then A C
B D
like this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900