On Sat, 20 Oct 2001, Adrian D'Costa wrote: | Date: Sat, 20 Oct 2001 12:04:53 +0530 (IST) | From: Adrian D'Costa <[EMAIL PROTECTED]> | To: Clyde Jones <[EMAIL PROTECTED]> | Cc: [EMAIL PROTECTED] | Subject: Re: how to get the correct result -- Thrid Time -- | | On Fri, 19 Oct 2001, Clyde Jones wrote: | | To me they are same, but since there is a space, they are not. What I | want is just one name | | > | > If you want to get only unique, non-blank results then | > | > SELECT DISTINCT | > replace(replace(nome_hotel,\n,""), " ", " ") | > from hotel | | The problem is that the space (" ") will match if there are two | spaces. I am not sure how may are there. | | Adrian
Did you try that? replace should recursively replace ALL double spaces, if it is a problem just run and rerun the query UPDATED hotel set nome_hotel replace(nome_hotel, " ", " ") until all the double spaces are gone. On your entry form you will want to do this so the data goes in the way you want it, not the way it was entered. Clyde -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin Clyde Jones - http://www.clydec.net --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php