Shlomi
Shlomi

Reputation: 367

postgres add value to an existing column

I have a table like this for example:

id, first_name, last_name
1, James, Anderson
2, William, Davis
3, Ethan, Walsh

I would like to add a prefix to their first names,
So it will looks like this:

id, first_name, last_name
1, EXT-James, Anderson
2, EXT-William, Davis
3, EXT-Ethan, Walsh

So basically I want to add the value 'EXT-' to the first_name column
Is there any way to do it ?

Upvotes: 0

Views: 3031

Answers (2)

Steve
Steve

Reputation: 5545

SELECT 'EXT-' || first_name FROM YourTable

Upvotes: 0

user330315
user330315

Reputation:

update the_table
  set first_name = 'EXT-'||first_name;

Upvotes: 3

Related Questions