I have 2 tables in my bd how can i do a query that joins the values of this 2 tables where id of table A is equal to Id_TABa:
Table A:
id
nome
correio
Table B:
Id_TABa
id
nome
I have 2 tables in my bd how can i do a query that joins the values of this 2 tables where id of table A is equal to Id_TABa:
Table A:
id
nome
correio
Table B:
Id_TABa
id
nome
SELECT * FROM tablea INNER JOIN tableb ON (tablea.id = tableb.Id_TABa);
There are several options :
SELECT *
FROM tableA
INNER JOIN tableB
ON tableA.id = tableB.id_TABa;
OR
SELECT *
FROM tableA, tableB
WHERE tableA.id = tableB.id_TABa;
The first one is faster (as far as i remember)