Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading