Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Re: Query
Miscellaneous
Thread ID:
00957852
Message ID:
00957868
Views:
23
You've to use either NOT IN or correlated subquery with NOT EXISTS.
Select Meeting_ID
	From Meetings
	Where Meeting_ID Not IN ( select meeting_ID from Events)

-- Or

Select Meeting_ID 
	From Meetings mt
	Where Not Exists ( select * from Events ev 
			WHERE ev.Meeting_ID = mt.Meeting_ID)
> I have a simple query. I have used this query successfuly in the past, however this time it is not working.
>
>Here is the query
>
>Select Meeting_ID
>From Meetings
>Where Not exists(select meeting_ID from Events)
>
>It should returns 1,3,35, because the Ids in Meetings tables (1,3,35) are not in the Events table. Instead it returns 0 records.
>What is wrong with my statement?
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform