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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-07-13 : 09:22:35
|
| krishnamoorthy writes "In oracle there is a set operator minus. I am sure that we don't have any such operator in sqlserver. Is there any way to achieve the same functionality?" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-13 : 09:51:04
|
| Think the minus operator compares resultsets and returns rows that are in the second but not in the first.for that you would need to join on all the columnsselect t1.* from tbl1 t1left jointbl2 t2on t1.col1 = t2.col1and t1.col2 = t2.col2...where t2.col1 is nullyou would have to deal with nulls if there are any nullable columnsthis would be the equivalent ofselect * from tbl1minusselect * from tbl2==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|