こちらのテーブルの内容が重複している内容があるため
まとめたいのですが、どのようにしたらまとめれますか?
同じIDが何個もありますが
それぞれのIDを1つずつにしたいです。
ID 2 が1つ
Id 3 が一つ
のようにしたいです。
そうすると、recipe_nameのシチューと肉じゃがが1つにまとまると思っています。
sql
1SELECT 2recipe.id, 3recipe.recipe_name, 4ingredient.ingredient_name, 5ingredient_type.ingredient_type, 6recipe_ingredient.ingredient_amount, 7review.comment, 8user.user_name 9FROM recipe 10JOIN recipe_ingredient 11ON recipe.id = recipe_ingredient.recipe_id 12JOIN ingredient 13ON recipe_ingredient.ingredient_id = ingredient.id 14JOIN ingredient_type 15ON ingredient.ingredient_type_id = ingredient_type.id 16JOIN review 17ON recipe.id = review.recipe_id 18JOIN user 19ON review.user_id = user.id;
ご教授頂けると嬉しいのです。
よろしくお願いします。
回答3件
あなたの回答
tips
プレビュー