-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, 19 Oct 2001, Clyde Jones wrote:
> 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.
Hmm... I learnt that 11 years ago :) Ok, I will tell you what I want. I
want all unique rows. Now if there are spaces in like:
| Abou Nawas Djerba |
| Abou Nawas Djerba |
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
>
>
>
> 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
>
>
> ----------------------------------------------------------------------
> gpg: Warning: using insecure memory!
> gpg: Signature made Fri 19 Oct 2001 07:13:23 PM IST using DSA key ID AA5040FF
> gpg: Can't check signature: public key not found
> ----------------------------------------------------------------------
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE70RsQ/f1mUNueu/oRAkaAAKCF+fvJuHkT0VBeggufv9J1PHQrXwCglcuu
7uCqVZa/IcZZb0n/clkvmlU=
=VCTo
-----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