SELECT DISTINCT
t1.name as t1_name,
MAX(t1.unit) as t1_unit,
MAX(t1.id_producer_goods) AS hi_id_producer_goods,
t2.name as t2_name
FROM Table1 t1
left join Table2 t2 on t1.id_web_site=t2.id_web_site
WHERE t1.id='23'
GROUP BY t1.name
クエリを実行すると、次のエラーが表示されます。
Column 'Table2.name' is invalid in the select list because it is not contained
in either an aggregate function or the GROUP BY clause.
このクエリの書き方