SQL Query - GREATEST & REPLACE
Posted: Fri Jan 30, 2004 3:41 pm
Hi everyone,
I have a field in my db with numbers like '20;30;10;50' (all in one field). I want to remove all but the highest number. Can I use syntax like the one below? It's not working for me.
SELECT GREATEST(REPLACE(Price, ";", ",")) as Price FROM nsninfo
UPDATE nsninfo SET Price = GREATEST(REPLACE(Price, ";", ","))
Thanks.
I have a field in my db with numbers like '20;30;10;50' (all in one field). I want to remove all but the highest number. Can I use syntax like the one below? It's not working for me.
SELECT GREATEST(REPLACE(Price, ";", ",")) as Price FROM nsninfo
UPDATE nsninfo SET Price = GREATEST(REPLACE(Price, ";", ","))
Thanks.