MySQL Forums
Forum List  »  Newbie

Re: SELECT mit NOT EXISTS
Posted by: Peter Brawley
Date: May 13, 2020 06:56PM

Problems with the requirement ...

- it refers to a status column but your DDL doesn't mention such a column

- it asks for person_ids ...

where group_id=1 with status=1
and group id=4 with status=0
AND group_id=1 and status=1 and not exists(group_id=4)

... implying that persons may belong to multiple groups, is that what's meant?

Also re the DDL, a Primary Key is by definition unique, so your person and gruppen table Unique keys are entirely redundant; and a Primary Key is obviously a key, so the gruppenzuordnung key(person_id) is also entirely redundant.

Options: ReplyQuote


Subject
Written By
Posted
May 13, 2020 08:53AM
May 13, 2020 06:01PM
Re: SELECT mit NOT EXISTS
May 13, 2020 06:56PM
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.