Table 1 -> id, name
Table 2 -> id, name, text_value, table1_id, table3_id
Table 3 -> id, name
SELECT * FROM `table1`
LEFT OUTER JOIN table2 ON table1.id = table2.table1_id
WHERE
(
(table2.table3_id = '7' AND table2.name like ('%test%'))
)
AND
(
table2.table3_id = '1' and table2.text_value like ('%fast update%'))
)
GROUP BY table1.id
ORDER BY table1.id desc
Yes, but you need two joins to do so:
use an alias. I chose
t2.ANDtoLEFT OUTER JOIN table2 AS t2 ON.table2tot2.GROUP BY, all the columns that you specify need to be in either theGROUP BYclause or an aggregate. Since you didn’t do that, and it is unclear why you tried to useGROUP BY, I am eliminating theGROUP BYclause.There are several other changes. See final query below: