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つの列があるかどうか疑問に思っていました
first name. last name.
データベースに保存するもの。
姓名から名前を自動的に作成する「動的」列「フルネーム」をデータベースに作成できますか?
firstname |lastname |fullname (this goes automatically) ----------------------------------------- foo |bar |foo bar
フルネームを選択したいだけなら、それを行うことができます:
select concat(firstname, ' ', lastname) as fullname from users
実際に列が必要な場合 (つまり、列に対して更新を実行できる場合)、それは不可能です。
次のようなことを試すことができます:
SELECT CONCAT(firstname, ' ', lastname) as firstlast FROM users