Reputation: 21
In Oracle, I can define a value for a column that doesn't exist in a table, like
SELECT
C.CUSTOMER_ID, ' ' CUSTOMER_PHONE , 'JAMAICAN' CUSTOMER_NATIONALITY.
I need to know if I can achieve the same in SQL Server.
Upvotes: 2
Views: 114
Reputation: 25132
Yes, very similar...
SELECT
C.CUSTOMER_ID,
,CUSTOMER_PHONE = ' '
,CUSTOMER_NATIONALITY = 'JAMAICAN'
FROM
YourTable
You will also see this column aliasing with the word AS
.
SELECT
C.CUSTOMER_ID,
,' ' AS CUSTOMER_PHONE
,'JAMAICAN' AS CUSTOMER_NATIONALITY
FROM
YourTable
Upvotes: 3