Raphael Matthias Krug wrote:
Hi Shawn,

I printed the manual, but as I am not such a database guru I was not able to transfer this knowlegde into an select-statement. Thanks for your realtimehelp.

Is it possible to do an select-query with soundex like the following examble?

select nn from table where nn !=''
my database has the field name (nn), I need to select every namefield, which is not empty. So soundex should give me an result with a list of names. How to do?


Thanks
Raphael

Am 31 Dec 2004 um 11:00 hat [EMAIL PROTECTED] geschrieben:



Did you think to check the manual?


English: http://dev.mysql.com/doc/mysql/en/String_functions.html

German http://dev.mysql.com/doc/mysql/de/String_functions.html

French: http://dev.mysql.com/doc/mysql/fr/String_functions.html

and your query would look like

SELECT ... FROM ... WHERE SOUNDEX(field1) = SOUNDEX(field2)

because you want to compare the "sound"of both fields to see if they
are nearly the same.


Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


"Raphael Matthias Krug" <[EMAIL PROTECTED]>wrote on 12/31/2004
10:46:06 AM:


Hi,

I need to compare names from different tables and therefore I need
to know the proper use of soundex. I googled for it, but could not

find


anything useful. And select soundex('text') is no help for me.

The query should look like this:
select field from table where field like [soundexquery inserted]

As result there should be a list with the names. The comparison of
the table can also be done with php, so mainly it would be great to
know how to do resultqueries as described.

Thanks for help! Happy new year

Raphael

Raphael:

I am not sure I am quite understanding what you are trying to do, but from what I've read it looks like you want to query the names of the fields rather than their values. MySQL does not store field names in tables, and this makes impossible to use any SQL functions on field names, only on the values they contain.

The best way to acccomplish this is to programmatically (eg. from PHP) execute SHOW FIELDS FROM tbl_name, and then post-process the output.

P.S. I have a theory that a habit of printing computer documentation is a road block to becoming a "guru". At least, I have not yet encountered a "guru" that printed much, while at the same time it seems like a struggling user prints a lot. You cannot be 100% sure about the cause and effect relationship, though, but trying to go printless might activate something that speeds up skill acquisition.


-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to