I have two tables like this:
--------- - -----------
- X - Y - - X - VALUE -
--------- - -----------
-x1 - y1- - x1- value1-
-x2 - y2- - x1- value2-
-x3 - y3- - x2- value3-
--------- - x3- value4-
- x3- value5-
- x3- value6-
-------------
I want join them like this:
-----------------
- X - Y - VALUE -
-----------------
-x1 - y1- value1-
- - - value2-
-x2 - y2- value3-
-x3 - y3- value4-
- - - value5-
- - - value6-
-----------------
I dont want to duplicate X values.
Can anybody show this query or give reference to somebodys example?
thanks!
It seems that you are trying to remove the X, Y values after the first occurrence. You can do this with most databases, using the row_number() function. I am calling the first table XY and the second table X