I know this thread is very old, but if someone needs an answer to a Nimmagadda question, you should accomplish this with something like:
SELECT name, city, addr, CASE name WHEN 'john' THEN 12345 WHEN 'peter' THEN 123 ELSE 0/*???? */END AS ph_no
FROM table1