-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sorry,
 I forgot to answer your question about similar rows.
 Rows 5208 and 3063 are NOT the same (row 5208 has spaces and returns),
besides your query asked for ALL rows not just the unique ones.

Remember, computers only give you what you asked for, not what you want.

If you want to get only unique, non-blank results then

 SELECT DISTINCT
  replace(replace(nome_hotel,\n,""), "  ", " ")
 from hotel
 WHERE
     nome_hotel NOT NULL
  or trim(nome_hotel) NOT LIKE ""
 order by nome_hotel
 limit 10;



On Fri, 19 Oct 2001, Adrian D'Costa wrote:

| Date: Fri, 19 Oct 2001 10:43:31 +0530 (IST)
| From: Adrian D'Costa <[EMAIL PROTECTED]>
| To: Clyde Jones <[EMAIL PROTECTED]>
| Subject: Re: how to get the correct result -- Thrid Time --
|
| Hi,
|
| Thanks.  It gave an error but it work after adding the "\n".  Now the
| result is:
|
| +------+-----------------------------+
| | id   | replace(nome_hotel,"\n","") |
| +------+-----------------------------+
| | 3825 |                             |
| | 3827 |                             |
| | 3391 | Abi d'Oru                   |
| | 5208 | Abou                   Nawas Djerba         |
| | 3063 | Abou Nawas Djerba           |
| | 1252 | Adams Beach                 |
| | 9757 | Aegean                         Village           |
| | 7973 | Aegean                      |
| | 8917 | Aegean Village              |
| | 8122 | Aegeon                      |
| +------+-----------------------------+
|
| If you notice id 5208 and 3063 are the same so also with 9757 and 7973.  I
| tried using trim it is the same.  Any pointers.
|
| Thanks
|
| Adrian
|
| On Thu, 18 Oct 2001, Clyde Jones wrote:
|
| > the doc page is here
| > http://www.mysql.com/doc/S/t/String_functions.html
| > try
| >
| >  select replace(nome_hotel,\n,"")
| >  from hotel
| >  group by nome_hotel limit 10;
| >

- -- 
"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

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBO9At+0P80ESqUED/EQICnwCgvVdsWfN0Nr4/HnRoa7/5UKCuYggAoOB1
g4svPHDm8QFnMXAAdE2RDYce
=ONgB
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
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

Reply via email to