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 |
|
k_cire0426
Yak Posting Veteran
63 Posts |
Posted - 2009-03-30 : 17:19:38
|
| query 1col1 col22007 testquery 2col1 col22008 test2resultcol1 col2 col3 col42007 test 2008 test2any ideas? |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2009-03-30 : 17:21:45
|
Post your actual query's. The quick solution is to just add a row_Number then join the tables. Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
k_cire0426
Yak Posting Veteran
63 Posts |
Posted - 2009-03-30 : 17:28:28
|
| query 1select * from table1 where col1 = testquery 2select * from table1 where col1 = test2 |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2009-03-30 : 17:30:26
|
[code]Select *from(Select Row_Number() over (Order by Col1) as RowID,*From Table1 where Col1 = 'Test') aInner join(Select Row_Number() over (Order by Col1) as RowID,*From Table1 where Col1 = 'Test2') bon a.RowID = b.RowID[/code] Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
|
|
|