mysql query with join
this is my database:
I would retrieve all records in richiestepreventivo where idImpres开发者_如何学Goa==xx and all the data in privati where privati.id==richiestepreventivo.idPrivato. Can you explain me how I have to set the query with join?
Thanks.
SELECT *
FROM privati AS p
INNER JOIN richiestepreventivo AS r
ON p.id = r.idPrivato
WHERE r.idImpresa = xx
Are you asking for a simple inner join
SELECT r.id, p.data
FROM richiestepreventivo r
JOIN privati p ON p.id = r.idPrivato
WHERE r.id = XX;
精彩评论