• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

replace with a select statment

select column1 from table1

if column1='bob', write 'bob evans'
0
rgb192
Asked:
rgb192
  • 2
1 Solution
 
ArgentiCommented:
Version 1:
select IF(column1='bob', 'bob evans', column1) as MyColumn
from table1

Open in new window


Version 2:
select case column1 when 'bob' then 'bob evans' else column1 end as MyColumn
from table1

Open in new window

0
 
rgb192Author Commented:
Thanks for 2 answers case and if
0
 
ArgentiCommented:
You're welcome :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now