TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Trifon Dinev
NA
273
0
Query pb
Nov 14 2011 12:00 PM
Hi All,
I have a table with this fields
create table stores(
id int primary key,
name nvarchar,
parentId int,
headofficeId int)
I have E.g.
1, 'A HO', 0, 0,
2, 'A1',1,1,
3,'A2',1,1,
4,'B HO',0,0,
5, 'B',4,2,
6,'B1'4,2
I want to have query, which gives me the id and name of 'A HO' when I read record 3 or record 2, the same way to see 'B HO' when I read record 5 or 6.
Help me please.
Kind regards,
Trifon.
Reply
Answers (
3
)
SQL Year function
Query Optimization in SQLSERVER