Hi all,
I have one table like
create table #table1(id int,name varchar(40))
insert into #table1
select 15 id,'Global' name
union
select 16 id,'Liberty' name
union
select 17 id,'Noble' name
and i have another table like
create table #table2(number int,id int,name varchar(50))
insert into #table2
select number=1,id=15,'James Monroe'name
union
select number=2,id=15,'Cornell'name
union
select number=3,id=15,'Abraham Lincoln'name
union
select number=4,id=16,'James K. Polk'name
union
select number=5,id=16,'Roosevelt'name
union
select number=6,id=16,'George Washington'name
union
select number=7,id=17,'Woodrow Wilson'name
union
select number=8,id=17,'Andrew Jackson'name
union
select number=9,id=17,'John Adams'name
i need to print the data like this
15,
3,
2,
1,
16 ,
6,
4,
5,
17,
8,
9,
7,