Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
coagulance
Yak Posting Veteran
78 Posts |
Posted - 2009-12-09 : 05:04:49
|
| Can any one one suggest , how to join two tables (without common columns) ie.. without the ON Criteria and also get distinct valuesTable_XVALUE DIMENSION200 299300 122200 144100 123Table_YVALUE DIMENSION600 599600 522400 164300 153Result should be:X_Value Y_Value100 300200 400300 600Thanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
coagulance
Yak Posting Veteran
78 Posts |
Posted - 2009-12-09 : 05:17:43
|
| It just merges two different columns of two different tables and sorts them in asc order. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-12-09 : 09:16:06
|
[code]select x.value, y.valuefrom( select Value, row_no = row_number() over (order by Value) from Table_X) xinner join( select Value, row_no = row_number() over (order by Value) from Table_Y) y on x.row_no = y.row_no[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|