I want to use such expression: SELECT orders
.ID client
FROM work
.orders
AS orders
, work
.base clients
AS base clients
WHERE orders
.ID client
= base clients
.ID
AND (orders
.ID категории
= 6 OR orders
.ID category
= 15 OR orders
.ID category
= 19 OR orders
.ID category
= 30 OR orders
.ID category
= 36) EXCEPT SELECT orders
.ID client
FROM work
.orders
AS orders
, work
.base clients
AS base clients
WHERE orders
.ID client
= base clients
.ID
AND orders
.ID category
= 36 AND orders
.ID order state
= 3
In two words: I need to get only that records from first SELECT which absent in second SELECT.
The problem is in word EXCEPT. Both SELECT expression is working good singly, but when I try to union it with EXCEPT operator there is a error:
“You have an error in your SQL syntax…near ’ EXCEPT SELECT…”
What is wrong??? I tried many different variants but no one is working.