• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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