By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

SQL Query Problem

P: 17
Hello Friends

I have following data in the table.


ID--------Name---------Code
---------------------------------------------
1---------Stone------------0
2---------Jewelry----------0
3---------Color Stone----1
4---------Ruby-------------3

Here 0 stands for primary type (stone) now I want to search primary type for ruby which is stone so how can I get that through sql query.

Thanking you in Advance

Waiting for your response
Mar 13 '08 #1
Share this Question
Share on Google+
2 Replies


code green
Expert 100+
P: 1,726
Here 0 stands for primary type (stone) now I want to search primary type for ruby which is stone
Nope, re-read this over but doesn't make sense.
It may help if you used meaningful field names
Mar 14 '08 #2

P: 17
Nope, re-read this over but doesn't make sense.
It may help if you used meaningful field names
[HTML]<pre>
Stone
/\
colorstone Pearl
/ \
Ruby
</pre>
[/HTML]


Now I want to search Root node(stone) from leaf node(ruby).In the table code stand for level where 0 means root node.
Mar 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.