Reputation: 65
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
Reputation: 8545
select fname,lname, (case when lname = 'John' then '*****' else city end) as city
from CLIENT
try this query.
Upvotes: 3