SQL Query put a word in a field instead of 0?

database, sql

Solution

You can do that with a CASE statement:

SELECT
CASE WHEN F2 = '0' THEN '(No Phone Number)' ELSE F2 END AS Phone
...

Problem

When i run sql query such as; ``` Select F1 as name, F2 as phone from Table where condition = true ``` If `F2 = 0` i need to that field to be `No Phone Number` instead of `null` or `0`

Original source