I know this is a simple questionf or you advanced SQL programmers, so I appreaciate you entertaining it.
How can I add a concatenated column to an existing table with the following columns?
Table Name: PRICE_BOOK
COLUMN 1 = COUNTRY (Example USA)
COLUMN 2 = ROLETITLE (EXAMPLE Manager)
I've been trying use
ALTER TABLE PRICE_BOOK
SELECT COUNTRY || ROLETITLE AS COUNTRYROLE
but I get an error
I am using SQL commnads in Apex
Really appreciate your help ;)
You don't need to add a concatenated column to a table; rather, you can select two (or more) columns from the table and concatenate them in your SQL. You had the answer, it was just over-engineered.
Simply issue this SQL from the SQL workshop to get what you're looking for:
SELECT country || roletitle countryrole FROM price_book
Hope this help!
- Scott -
Edited by: Scott on Dec 6, 2012 5:52 PM