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 |
|
andrewcw
Posting Yak Master
133 Posts |
Posted - 2006-04-27 : 16:22:52
|
| I have 2 tables - like this: My goal is to find what is new ( different in the first tablestatlineNrTestlinenr123789StatLineNrProced123I saw this query, but in my query pane in VS I get an odd error (Unable to parse query text) before it will execute, and the result set is 123 not 789. Any ideas what could be the problem. ( SQL 2000) SELECT linenrFROM statlineNrTest minus SELECT linenr FROM StatLineNrProcedandrewcw |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-27 : 16:26:22
|
| Minus isn't valid in SQL Server. What you need is LEFT OUTER JOIN. This should do it:SELECT t.linenrFROM statlineNrTest tLEFT OUTER JOIN StatLineNrProced pON t.linenr = p.linenrWHERE p.linenr IS NULLTara Kizeraka tduggan |
 |
|
|
andrewcw
Posting Yak Master
133 Posts |
Posted - 2006-04-27 : 16:33:32
|
| Reply - Thank you for showing me how a left join will work !! - what then does the term intersect correspond to ??andrewcw |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-04-27 : 16:38:41
|
| Are you referring to the Intersect function in Analysis Services? Or are you referring to the different join types? If join types, start reading up on them in SQL Server Books Online. They are well documented in there.Tara Kizeraka tduggan |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|