Unix Technical Forum

"except" or "minus" with Sybase ASE 12.5 ?

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 ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 05:07 PM
sa
 
Posts: n/a
Default "except" or "minus" with Sybase ASE 12.5 ?

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 05:08 PM
Anthony Mandic
 
Posts: n/a
Default Re: "except" or "minus" with Sybase ASE 12.5 ?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com