SQL, deduplicate query distinct & nbsp; select & nbsp; DISTINCT & nbsp; 'object _ id', & nbsp; t3.width & nbsp; as & nbsp; width, & nbsp; t3.height & nbsp; as & nbsp; height, t3.ismark & nbsp; as & nbsp; ismark, & nbsp; t2.rtime & nbs SQL, deduplicated query distinct
Select DISTINCT 'object _ id', t3.width as width, t3.height as height, t3.ismark as ismark, t2.rtime as add_time, t1.add _ author as add_author, t1.image _ url as image_url, t1.id as id, t1.browse _ real_cnt as browse_real_cnt
From comments as t2
Left join ornamentations as t1 on t1.id = t2.object _ id
Left join ornamentation_images as t3 on t3.ornamentation _ id = t1.id
Where (t2.uid = 1013) AND (t1.enable = '0 ')
Order by t2.id desc LIMIT 0, 5
The condition after select is normal with t3, which can be repeated. after t2 is added, t1 cannot be repeated.
------ Solution ----------------------
DISTINCT acts on the entire line
It's hard to say that your three tables only have one to multiple tables.