Trifon Dinev

Trifon Dinev

  • NA
  • 269
  • 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. 

Answers (3)