Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の問題があります.2つのテーブルUSERとMESSAGES. は、テーブル内のUser.IDフィールドの FKです。MESSAGES.CREATED_BYMessages
USER
MESSAGES
User.ID
MESSAGES.CREATED_BY
Messages
すでに 2 つのテーブルを INNER JOIN で結合していますが、テーブルの列messages.Created_BYとしてSELECT を表示したいと思いますか? 副選択は、返されるデータが多すぎるというエラーにより機能しません。User.LoginnameUSER
messages.Created_BY
User.Loginname
SELECT messages.id, messages.body, u.Loginname AS Created_by FROM messages m JOIN user u ON (m.created_by=u.id)
フィールド名messages.id、messages.body、user.idをお持ちのものに変更してください。