Results 1 to 2 of 2
Nov 28, 2005, 11:08 #1
- Join Date
- Mar 2005
- 0 Post(s)
- 0 Thread(s)
Problems writing a query in MSSQL
Hi guys, this is my first post here. I'm having a lot of trouble writing a fairly simple(i think) query. Here's the situation.
I have a database for an online shopping system that uses Modified Preordered Tree Traversal. basically i need to make a query that does the following:
Select fields named c_left and c_right from a table named categories where the id = a value that will be set by my asp code. For now lets say we need to select c_left and c_right from categories where id=16. then based on the c_left and c_right values i have returned from this i need to select * from categories where c_left > the c_left found from part one of the query and c_right < the c_right from part one.
Any help on this would be greatly appreciated.
Nov 28, 2005, 12:20 #2
- Join Date
- Jan 2004
- Uppsala, sverige
- 2 Post(s)
- 1 Thread(s)
Select * from categories where c_left > (select c_left from categories where id = <aspVariable>) and c_right < (select c_right from categories where id = <aspVariable>)