December 13, 2010 at 9:38 am
Hi,
I have two queries, say for example
Select distinct 0 parent_id, ROW_NUMBER() OVER(
ORDER BY Column2_Desc ) AS 'ID', Column2_Desc
From table1
Union
Select distinct 0 parent_id, ROW_NUMBER() OVER(
ORDER BY Column2_Desc ) AS 'ID', Column2_Desc
From table2
I don’t have relationship between two tables.But I want to frame parent child relationship between these two so that my resultset should like
Parent_id id Column2_Desc
0 1 ABC
0 2 XYZ
0 3 ASDF
1 4 VGTY
2 5 DFT
I don’t want to use stored procedure.
Kindly Help Me Out
December 19, 2010 at 4:46 pm
brindaam (12/13/2010)
Hi,I have two queries, say for example
Select distinct 0 parent_id, ROW_NUMBER() OVER(
ORDER BY Column2_Desc ) AS 'ID', Column2_Desc
From table1
Union
Select distinct 0 parent_id, ROW_NUMBER() OVER(
ORDER BY Column2_Desc ) AS 'ID', Column2_Desc
From table2
I don’t have relationship between two tables.But I want to frame parent child relationship between these two so that my resultset should like
Parent_id id Column2_Desc
0 1 ABC
0 2 XYZ
0 3 ASDF
1 4 VGTY
2 5 DFT
I don’t want to use stored procedure.
Kindly Help Me Out
I know this post is almost a week old but if you don't have an answer yet, try reading the article at the first post in my signature line below... it'll help you get an answer.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply