Jump to content
Server Maintenance This Week. ×

Criteria on other side of join


This topic is 2825 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all

Can someone tell me if this query is correct? I'm trying to find all currently open Cases, but only those that belong to a personnel whose 'exclude_from_stats' field is null.
So far this does seem to give me the correct results, however I am a bit uncertain as I have been having problems recently defining criteria in related records. It seems that you sometimes have to resort to different types of joins or you run the risk of excluding/including too many records.

SELECT COUNT (*) FROM Cases C
JOIN Personnel P ON p.personnel_ID = c.User_IDF 
WHERE c.Closed IS NULL AND p.exclude_stats IS NULL

Many thanks

Link to comment
Share on other sites

This topic is 2825 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.