Home > Mobile >  how to insert concat command ,and the return result is like select
how to insert concat command ,and the return result is like select

Time:12-26

enter image description here what command do i have to write to have fullname columns = student_first_name student_last_name.

i only know select concat command to filter, i want here that it will insert and display as select concat command.

CodePudding user response:

add a new column to table and then use update command to ensure that you fill full name. Using for string is ill-advised since it is mostly for varchar values not nvarchar values. query in SQL Server

ALTER TABLE yourtable
ADD FullName VARCHAR(100); 

UPDATE yourtable
SET FullName=CONCAT(student_first_name ,student_last_name)
--SET FullName=student_first_name  student_last_name

query in MYSQL

ALTER TABLE yourtable
ADD COLUMN FullName VARCHAR(100) AFTER student_last_name;
UPDATE yourtable
SET FullName = CONCAT(student_first_name ,student_last_name)
--SET FullName=student_first_name  student_last_name
  • Related