This is a discussion on "except" or "minus" with Sybase ASE 12.5 ? within the Sybase forums, part of the Database Server Software category; --> Hi, I have to do a "select" operation on 2 tables a and b, from 2 databases located on ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I have to do a "select" operation on 2 tables a and b, from 2 databases located on 2 different server. (I work on the first server which contains the table a. I've also built a remote server and a proxy table to access table b on the second server. Servers are all Sybase ASE 12.5). My problem is that I have to compare data on these two tables in order to get the difference between them. In another words, to do: select * from a substract select * from b But either "minus", "except" nor "substract" work on sybase. What should I do? Thanks for your answers. |
| ||||
| sa wrote: > > I have to do a "select" operation on 2 tables a and b, from 2 > databases located on 2 different server. > (I work on the first server which contains the table a. I've also > built a remote server and a proxy table to access table b on the > second server. Servers are all Sybase ASE 12.5). > My problem is that I have to compare data on these two tables in order > to get the difference between them. > > In another words, to do: > select * from a > substract > select * from b > > But either "minus", "except" nor "substract" work on sybase. > What should I do? What you want is the set difference. The ANSI standard defines 'except' for this but its not implemented in ASE. Fortunately, there are alternate methods. The traditional approach was to use 'not in' or 'not exists' with a subquery. Howver, ANSI outer joins are faster and fully supported. -am © 2005 |
| Thread Tools | |
| Display Modes | |
|
|