SQL MINUS/EXCEPT

73 views
Skip to first unread message

Xavier Diab

unread,
Sep 21, 2009, 4:47:59 AM9/21/09
to intersystems.public.cache
Hi

Can't seem to get the minus or except (tried both syntaxes) on caché.
Any idea

Select code, name from ClientForm
EXCEPT
Select code, name from ClientForm Where country='FR'

>> ERROR #5540: SQLCODE: -25 Message: Input (SELECT) encountered after end of query


Thx
Xavier

Sukesh Hoogan

unread,
Sep 21, 2009, 9:35:48 AM9/21/09
to intersystems...@googlegroups.com
Xavier

Try

SELECT code, name FROM ClientForm WHERE country<>'FR'

Regards
Sukesh Hoogan
Bombay, India
- Enterprise Resource Planning
- Business Intelligence
- Financial Accounting
- Offshore Development

Xavier Diab

unread,
Sep 29, 2009, 10:38:32 AM9/29/09
to intersystems.public.cache
The querry was just for example purpose
Is the Except instruction implemented in caché and in what syntax plz

Thx
Xavier

Sukesh Hoogan

unread,
Sep 30, 2009, 1:57:59 AM9/30/09
to intersystems...@googlegroups.com
Xavier

Does not seem to be. EXCEPT is a reserved word in CacheSQL probably on
account of T-SQL syntax.

I am sure you are aware of the equivalent query in Caché

SELECT code, name FROM ClientForm WHERE country NOT IN (SELECT country
FROM ClientForm WHERE country='FR')
Reply all
Reply to author
Forward
0 new messages