Skip to content

Instantly share code, notes, and snippets.

@alexanderjsingleton
Last active February 19, 2016 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderjsingleton/6ae45917b2830789bb19 to your computer and use it in GitHub Desktop.
Save alexanderjsingleton/6ae45917b2830789bb19 to your computer and use it in GitHub Desktop.
A SQL solution using a CASE statement.
SELECT * FROM (
SELECT student_id,
salutation,
CASE
WHEN salutation IN('Dr.') THEN 'Doctor'
END AS NewSalutation
FROM student.student
)
WHERE NewSalutation IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment