这是我正在做的 MySQL:
mysql> select "Le Café de la Mairie" as titre, "15 pl Mairie" as adresse1, id from ville where sound=soundex('FERTE SOUS JOUARRE') and cp='77260';
+-----------------------+--------------+-----+
| titre | adresse1 | id |
+-----------------------+--------------+-----+
| Le Café de la Mairie | 15 pl Mairie | 447 |
+-----------------------+--------------+-----+
1 row in set (0.00 sec)
mysql> select "Le Café de la Mairie" as titre, "15 pl Mairie" as adresse1, id from ville where sound=soundex('FERTE SOUS JOUARRE') and cp='77261';
Empty set (0.00 sec)
mysql>
这就是我想要的:
mysql> select "Le Café de la Mairie" as titre, "15 pl Mairie" as adresse1, id from ville where sound=soundex('FERTE SOUS JOUARRE') and cp='77260';
+-----------------------+--------------+-----+
| titre | adresse1 | id |
+-----------------------+--------------+-----+
| Le Café de la Mairie | 15 pl Mairie | 447 |
+-----------------------+--------------+-----+
1 row in set (0.00 sec)
mysql> **(same query but dont find a record)**;
+--------------+------------+------+
| titre | adresse1 | id |
+--------------+------------+------+
| NULL | NULL | NULL |
+--------------+------------+------+
mysql>
当然,我已经 google & search stackoverflow。