MySQL Forums
Forum List  »  Newbie

SELECT mit NOT EXISTS
Posted by: Hans Huber
Date: May 13, 2020 08:53AM

Hi,

i need a SELECT for my Database but I dont know how to do it. Probably its easy but im searching now for 3 hours in the web and don't find a clou to this. So here is the thing...

I have 3 Tables

Table 1 person with person_id
Table 2 groups with a group_id
table 3 assign where assign the group_id to the person_id and give it a status 1 or 0

I want to know all person_id's who have the group_id=1 with status=1 and group id=4 with status=0 AND the people who have group_id=1 with status=1 and group_id=4 does not exist.

Can someone help me with that?

Thanks a lot for your help.

Options: ReplyQuote


Subject
Written By
Posted
SELECT mit NOT EXISTS
May 13, 2020 08:53AM
May 13, 2020 06:01PM
May 13, 2020 07:13PM
May 14, 2020 05:57PM
May 19, 2020 10:11AM
May 20, 2020 09:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.