I have table Events
| EVENT_ID | OTHER |
----------------------------
| | |
| | |
| | |
and table EventCategories that contains foreign key for Event table:
| TABLE_ID | EVENT_ID |
----------------------------
| | |
| | |
| | |
I need all EVENT_ID that are within Events table but are not in EventCategories table.
SELECT EVENT_ID FROM Events
WHERE EVENT_ID NOT IN
(
SELECT DISTINCT EVENT_ID
FROM EventCategories
)
How can I write criteria query ?