Hello
Please help in the preparation of the request. there are three tables, two of them in join like this:
SELECT t1.* FROM table1 t1, table2 t2 WHERE t1.id1 = t2.id2 limit 10
you need to add a third table so that for each record was a counter
SELECT COUNT(*) as mycount FROM table3 t3 WHERE t3.target_id = t1.id
and add a condition on it
mycount > 2
and sorting
order by mycount DESC
I did it only through having, but the explain request told me what needs to be redone. I ask for help.
those. make one query from three tables, and on the third query you need to calculate and get the output and the number and sorting by this field and another condition on it