Link to home
Start Free TrialLog in
Avatar of 28Joplin
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.
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

(field1 + field2) as OneColumn
Oops sorry, I gave you sql server syntax.

Should be:

Column1 || Column2

Or you can add some space:

Column1 |' '| Column2
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 28Joplin
28Joplin

ASKER


INSERT INTO emps
 (employees.first_name, employees.last_name) AS Full_Name
                                              *

ERROR at line 2:
ORA-00926: missing VALUES keyword ??

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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's for Oracle 11.  Thanks much!