Hi all,
Anyone know how to replace an empty string (i.e. '') with another string?
This works:
dbadmin=> select replace('TEST', 'TEST', 'FOUND');
replace
---------
FOUND
(1 row)
But this does not:
dbadmin=> select replace('', '', 'FOUND');
replace
---------
(1 row)
Empty string handling...
Moderator: NorbertKrupa
Empty string handling...
Thanks,
Juliette
Juliette
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Empty string handling...
Hi Julie,
You can use a CASE statement:
dbadmin=> select case '' when '' then 'FOUND' else '' end;
case
-------
FOUND
(1 row)
You can use a CASE statement:
dbadmin=> select case '' when '' then 'FOUND' else '' end;
case
-------
FOUND
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.