user259584
user259584

Reputation: 65

Replace a specific column characters in sql

I have a table named CLIENT with 3 columns (fname,lname,city).

I want to select all 3 columns but when lname = 'John' I want to show '*****' instead of the actual city

Upvotes: 0

Views: 45

Answers (1)

Akshey Bhat
Akshey Bhat

Reputation: 8545

select fname,lname, (case when lname = 'John' then '*****' else city end) as city
from CLIENT

try this query.

Upvotes: 3

Related Questions