28Joplin
asked on
SQL, How do I add a column in a table that contains two columns from another table (first name + last name)?
I have created a table called EMPS that contains all the rows and columns currently in the employees table. Now I need to add a column named Full_Name that contains the employee first name concatenated with the employee last name. Any help to a newbie would be very helpful.
(field1 + field2) as OneColumn
Oops sorry, I gave you sql server syntax.
Should be:
Column1 || Column2
Or you can add some space:
Column1 |' '| Column2
Should be:
Column1 || Column2
Or you can add some space:
Column1 |' '| Column2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
INSERT INTO emps
(employees.first_name, employees.last_name) AS Full_Name
*
ERROR at line 2:
ORA-00926: missing VALUES keyword ??
ASKER
Alter table emps add
Full_Name AS Coalesce(FirstName+' '+LastName, FirstName, LastName)
Alter table emps add
*
ERROR at line 1:
ORA-00406: COMPATIBLE parameter needs to be 11.0.0.0.0 or greater
ORA-00722: Feature "Virtual columns"
??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It's for Oracle 11. Thanks much!