0

Can y’all help me

So I’m new in this and I’m using Phpmyadmin but how can I make my table check if the Person 1 is Equal to person 2 Like Mike is the Brother of Mike this should be false So I want to make a Constraint I heard I can do this with Check Where I only have to put SELECT TABLE Blabla CHECK (Person1 !=Person2); But I don’t know 1. where to put this and 2. How to make a Warning „ Mike can’t be his own brother“ I hope I could explain my Problem and you guys could help me

30th Nov 2019, 7:50 PM
Mumtaz Colkusu
Mumtaz Colkusu - avatar
2 Respostas
+ 1
Are you looking for the where clause. SELECT * FROM sites WHERE site_name = 'TechOnTheNet.com'; https://www.techonthenet.com/mariadb/where.php SELECT * FROM blabla WHERE Person1 !=Person2;
30th Nov 2019, 8:26 PM
sneeze
sneeze - avatar
0
thank yall for the help so I did now made a constraint ALTER TABLE Person ADD CONSTRAINT CHK_PERSON CHECK(Person1ID<>Person2ID) that should only accept valid relationships
3rd Dec 2019, 3:09 AM
Mumtaz Colkusu
Mumtaz Colkusu - avatar