Page 1 of 1

SQL Query - GREATEST & REPLACE

Posted: Fri Jan 30, 2004 3:41 pm
by phoggy
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.

Posted: Fri Jan 30, 2004 8:50 pm
by phoggy
Never mind, it does work
[edit]
I take that back it doesn't: i get an error when running:
"parse error, unexpected ',' "
Anybody know why?