For joint queries between two tables, the fid of the sub-table has the same one and only takes one. how can I write an SQL statement? At the end of this post, dfwye edited two tables for joint queries from 2012-11-0919: 45: 23. The fid of the sub-table has the same one. how can I write an SQL statement? Table & nbsp; imgtitleid & nbsp; title & nbsp; & two tables join query, if the fid of a sub-table has the same one, how can I write an SQL statement?
At the end of this post, dfwye edited two table joint queries at 19:45:23 on. The child table fid has the same one and only takes one query. how do I write an SQL statement?
Table imgtitle
Id title time conone
Subtable imginfo
Img_id fid miaoshu
Query conditionsId = fid. The child table fid has the same one and only takes one
Result:Id title time miaoshu table imgtitle value of the latest 10 records
I will only write SELECT 'id', 'title', 'time', 'miaoshu 'FROM 'imgtitle', 'imginfo' where id = fid ORDER BY id DESC LIMIT 10, the results of this query are also listed in the imginfo fid of the subtable.
How can I write an SQL statement with the same fid as a sub-table?
Please kindly advise. Thank you!
------ Best solution --------------------
Select * from 'imgtitle', 'imginfo' where 'imtitle '. 'id' = 'miaoshu '. 'fid' group by 'miaoshu '. 'fid' order by 'imgtitle '. 'id' desc limit 10
------ Other solutions --------------------
SELECT a. id , a.title, a.time, b.miaoshu FROM `imgtitle` a
inner join
(
SELECT ` fid `,`miaoshu` from `imginfo` group by fid
) b
on a.id=b.fid ORDER BY a.id DESC LIMIT 10
------ Other solutions --------------------
Thanks to the two enthusiastic people, I used the first floor method. Thank you!