Database Reference
In-Depth Information
postgres=# select format_us_full_name('Mr',
'Martin', 'L', 'King', 'Jr');
format_us_full_name
-------------------------
Mr. Martin L. King, Jr.
(1 row)
postgres=# select format_us_full_name('',
'Martin', 'L', 'King', 'Jr');
format_us_full_name
---------------------
Martin L. King, Jr.
(1 row)
Another way to use conditional expressions is by using the IF/THEN/ELSE blocks.
The following is the same function again written using IF statements rather than
CASE statements:
CREATE OR REPLACE FUNCTION format_us_full_name(
prefix text,
firstname text,
mi text, lastname
text,
suffix text)
Search WWH ::




Custom Search