3
I have 2 tables, one of users and one of confirmed emails, which has a user FK and a confirmed user bool:
- tbl_valida_email
=========================
fk_id_usuario
usuario_confirmado
I was using the following query for this:
SELECT * FROM tbl_usuario WHERE email='email' AND senha='senha' AND (SELECT valido FROM tbl_valida_email WHERE id_usuario=(SELECT id FROM tbl_usuario WHERE email='email' AND senha='senha'));
And in my opinion, it’s too complex for one simple thing. How to improve it?
Exactly what I wanted, did not know that the Ner Join was used for this. : The
– Francisco
@Francis I shall shortly give a more detailed explanation
– Sorack