Ask a basic question about mysql multi-table joint query: how to limit a table to query only one data is as follows: query images from Table, at the same time, I joined Table B to check the image set name. now I only want to get a record from Table c. How can I write it? The current statement is probably like this & nbsp; select & nbsp;. *, B. name, c. * & nbsp; from & nbsp; a & nbsp; as & nbsp;
The requirement is as follows: query the image from Table a, view the image set name from Table B, and view the image comments from Table c.
Now I only want to get a record from Table c. How can I write it?
The current statement is probably like this select. *, B. name, c. * from a as a left join B as B on. pid = B. pid left join c as c on. pid = c. pid where. pid = XXX
But how can I modify the number of comments and the number of data records?
Analyze an SQL statement and use the php foreach loop to query B c after table A is checked. the efficiency difference is not big.
Only 20 points ~~~
Mysql join SQL
------ Solution --------------------
Cannot I use limit 1?
Or use the group by c. primary key.
------ Solution --------------------
Connected later: group by c. pid