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 |
|
LacOniC
Starting Member
29 Posts |
Posted - 2008-11-05 : 09:47:09
|
| SELECT * FROM Table1 t1JOIN Table2 t2 ON t1.Year= t2.YearWHERE t1.Year in (t2.Year, t2.Year- 1)Result only give me "WHERE t1.ID in (t2.Year)" section, "t2.Year - 1" doesn't work. What can be the problem? |
|
|
bjoerns
Posting Yak Master
154 Posts |
Posted - 2008-11-05 : 09:57:29
|
| The join gives you only results where t1.Year = t2.Year already. |
 |
|
|
LacOniC
Starting Member
29 Posts |
Posted - 2008-11-05 : 10:01:15
|
| I noticed it. Thank you. |
 |
|
|
|
|
|