Ben tamamen stumped: MySQL sorguda birbirine karşı iki tablo denetimi

0 Cevap php

Ben bir kelime sorunu yazıyorum, ama bu beni gerçekten şaşırtıcı gibi hissediyorum ve ben gerçekten burada birisi çözebilir umuyoruz:

I want to select one row from table A. Table A includes the attributes Name and Number. But before I finish the query, I want to check it against table B. Table B includes Name, Number, and the Username of the user. Based on the users' input, it inserts rows into table B that include their Username along with a Name and Number. Now in my query where I select a row from table A, I want to make sure that there are no rows in table B with matching Name and Number for that particular User.

I have tried WHERE (A.Name = B.Name AND A.Number = B.Number AND B.Username != '$username') but I think I was way off base with that. Any help would be... amazing.

0 Cevap