Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SQL problem

4 posts in General Discussion Last posting was on 2003-11-14 15:54:30.0Z
Lars Juel Jensen Posted on 2003-11-13 10:23:46.0Z
From: "Lars Juel Jensen" <larsjens@online.no>
Newsgroups: ianywhere.public.general
Subject: SQL problem
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 64.28.27.211
X-Original-NNTP-Posting-Host: 64.28.27.211
Message-ID: <3fb35bb2@forums-1-dub>
Date: 13 Nov 2003 02:23:46 -0800
X-Trace: forums-1-dub 1068719026 64.28.27.211 (13 Nov 2003 02:23:46 -0800)
X-Original-Trace: 13 Nov 2003 02:23:46 -0800, 64.28.27.211
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2071
Article PK: 4288

I need to do the opposite of a UNION operation..
How do I accomplish this?

( SELECT A,B,C FROM TABLE )
SUBTRACTION
( SELECT A,B,C FROM TABLE WHERE A=X )

Any ideas?
The NOT IN search condition is not able to test on more than one column of
data as far as I know...


"Chris Werner" <cw[please_no_spam] Posted on 2003-11-13 10:45:21.0Z
From: "Chris Werner" <cw[please_no_spam]@f-s.de>
Newsgroups: ianywhere.public.general
References: <3fb35bb2@forums-1-dub>
Subject: Re: SQL problem
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: fs-software.berlin.kkf.net
Message-ID: <3fb3620b$2@forums-2-dub>
X-Original-Trace: 13 Nov 2003 02:50:51 -0800, fs-software.berlin.kkf.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 13 Nov 2003 02:36:16 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 13 Nov 2003 02:45:21 -0800
X-Trace: forums-1-dub 1068720321 10.22.108.75 (13 Nov 2003 02:45:21 -0800)
X-Original-Trace: 13 Nov 2003 02:45:21 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2072
Article PK: 4289

two possibilities:

1.) not exists :
select a, b, c from table t1
where not exists ( select 1 from table t2 where t2.a = t1.a and t2.b = t1.b
and t2.c = t1.c )

2.) except (from doc):
select-statement
EXCEPT [ ALL | DISTINCT ] select-statement
[ EXCEPT [ ALL | DISTINCT ] select-statement ] ...
[ ORDER BY integer [ ASC | DESC ], ... ]

Usage
The differences between the result sets of several SELECT statements can be
obtained as a single result using EXCEPT or EXCEPT ALL. EXCEPT DISTINCT is
identical to EXCEPT.



Chris Werner




"Lars Juel Jensen" <larsjens@online.no> schrieb im Newsbeitrag
news:3fb35bb2@forums-1-dub...

> I need to do the opposite of a UNION operation..
> How do I accomplish this?
>
> ( SELECT A,B,C FROM TABLE )
> SUBTRACTION
> ( SELECT A,B,C FROM TABLE WHERE A=X )
>
> Any ideas?
> The NOT IN search condition is not able to test on more than one column of
> data as far as I know...
>
>

arrowdn.gif

Lars Juel Jensen Posted on 2003-11-13 15:04:42.0Z
From: "Lars Juel Jensen" <larsjens@online.no>
Newsgroups: ianywhere.public.general
References: <3fb35bb2@forums-1-dub> <3fb3620b$2@forums-2-dub>
Subject: Re: SQL problem
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 64.28.27.211
X-Original-NNTP-Posting-Host: 64.28.27.211
Message-ID: <3fb39d8a@forums-1-dub>
Date: 13 Nov 2003 07:04:42 -0800
X-Trace: forums-1-dub 1068735882 64.28.27.211 (13 Nov 2003 07:04:42 -0800)
X-Original-Trace: 13 Nov 2003 07:04:42 -0800, 64.28.27.211
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2073
Article PK: 4292

I think I will have to stick to the not exists approach since SQL Anywhere
7.0.3 does not support the EXCEPT operation.

I'm not quite sure what is goin on there, and the SQL I need is a bit more
complicated than the example that I gave earlier.

"Chris Werner" <cw[please_no_spam]@f-s.de> wrote in message
news:3fb3620b$2@forums-2-dub...
>
> two possibilities:
>
> 1.) not exists :
> select a, b, c from table t1
> where not exists ( select 1 from table t2 where t2.a = t1.a and t2.b =
t1.b
> and t2.c = t1.c )
>
> 2.) except (from doc):
> select-statement
> EXCEPT [ ALL | DISTINCT ] select-statement
> [ EXCEPT [ ALL | DISTINCT ] select-statement ] ...
> [ ORDER BY integer [ ASC | DESC ], ... ]
>
> Usage
> The differences between the result sets of several SELECT statements can
be
> obtained as a single result using EXCEPT or EXCEPT ALL. EXCEPT DISTINCT is
> identical to EXCEPT.
>
>
>
> Chris Werner
>
>
>
>
> "Lars Juel Jensen" <larsjens@online.no> schrieb im Newsbeitrag
> news:3fb35bb2@forums-1-dub...
> > I need to do the opposite of a UNION operation..
> > How do I accomplish this?
> >
> > ( SELECT A,B,C FROM TABLE )
> > SUBTRACTION
> > ( SELECT A,B,C FROM TABLE WHERE A=X )
> >
> > Any ideas?
> > The NOT IN search condition is not able to test on more than one column
of
> > data as far as I know...
> >
> >
>
>
>


Chris Keating (iAnywhere Solutions) Posted on 2003-11-14 15:54:30.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <3fb35bb2@forums-1-dub> <3fb3620b$2@forums-2-dub> <3fb39d8a@forums-1-dub>
Subject: Re: SQL problem
Lines: 91
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: keating-xp.sybase.com
X-Original-NNTP-Posting-Host: keating-xp.sybase.com
Message-ID: <3fb4fab6$1@forums-1-dub>
Date: 14 Nov 2003 07:54:30 -0800
X-Trace: forums-1-dub 1068825270 172.31.140.66 (14 Nov 2003 07:54:30 -0800)
X-Original-Trace: 14 Nov 2003 07:54:30 -0800, keating-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2086
Article PK: 4303

Support for EXCEPT was introduced in ASA9.

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

****************************************************************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

"Lars Juel Jensen" <larsjens@online.no> wrote in message
news:3fb39d8a@forums-1-dub...
> I think I will have to stick to the not exists approach since SQL Anywhere
> 7.0.3 does not support the EXCEPT operation.
>
> I'm not quite sure what is goin on there, and the SQL I need is a bit more
> complicated than the example that I gave earlier.
>
> "Chris Werner" <cw[please_no_spam]@f-s.de> wrote in message
> news:3fb3620b$2@forums-2-dub...
> >
> > two possibilities:
> >
> > 1.) not exists :
> > select a, b, c from table t1
> > where not exists ( select 1 from table t2 where t2.a = t1.a and t2.b =
> t1.b
> > and t2.c = t1.c )
> >
> > 2.) except (from doc):
> > select-statement
> > EXCEPT [ ALL | DISTINCT ] select-statement
> > [ EXCEPT [ ALL | DISTINCT ] select-statement ] ...
> > [ ORDER BY integer [ ASC | DESC ], ... ]
> >
> > Usage
> > The differences between the result sets of several SELECT statements can
> be
> > obtained as a single result using EXCEPT or EXCEPT ALL. EXCEPT DISTINCT
is
> > identical to EXCEPT.
> >
> >
> >
> > Chris Werner
> >
> >
> >
> >
> > "Lars Juel Jensen" <larsjens@online.no> schrieb im Newsbeitrag
> > news:3fb35bb2@forums-1-dub...
> > > I need to do the opposite of a UNION operation..
> > > How do I accomplish this?
> > >
> > > ( SELECT A,B,C FROM TABLE )
> > > SUBTRACTION
> > > ( SELECT A,B,C FROM TABLE WHERE A=X )
> > >
> > > Any ideas?
> > > The NOT IN search condition is not able to test on more than one
column
> of
> > > data as far as I know...
> > >
> > >
> >
> >
> >
>
>