Skip to content
Advertisement

SQL Check if the User has IN and Out

I need help getting the User which has an ‘IN’ and ‘Out’ in Column isIN. If the user has an IN and OUT do not select them in the list. I need to select the user who has only had an IN. Please I need help. Thanks in advance.

This is the table:

Need to get the result like

I tried using this query and sample query below but it doesn’t work.

Advertisement

Answer

You can use not exists:

If you want only users that meet the condition (and not the full rows):

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement