开发者

mysql query with join

this is my database:

mysql query with join

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜