Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.8.8/8.7.5) with ESMTP id RAA07953 for ; Mon, 4 May 1998 17:07:37 -0400 (EDT) Received: from lscorp.com (poohbah.lscorp.com [207.152.64.2]) by trends.net (8.8.8/8.8.8) with ESMTP id QAA04344 for ; Mon, 4 May 1998 16:13:24 -0400 (EDT) Received: from [207.152.64.133] by lscorp.com with SMTP (Eudora Internet Mail Server 1.2); Mon, 4 May 1998 15:03:20 -0500 X-Sender: lynch@poohbah.lscorp.com Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: pgsql-sql@postgresql.org From: lynch@lscorp.com (Richard Lynch) Subject: Search Matching Date: Mon, 4 May 1998 15:03:20 -0500 Is there some easy way to: 1. Match multiple fields with the same key select * from table where * ~* 'key'; 2. Get a count of the number of matches: EG: table: First | Last -------------------- John | Doe Jane | Doe John | Johnson I need a query that given 'John' and 'Doe' would return something like: Score | First | Last ----------------------- 2 | John | Doe 2 | John | Johnson 1 | Jane | Doe I guess I want a search engine just like the big boys, but I don't want to get too carried away with coding it up in PHP if there's some SQL that will do it faster/better. :-) -- -- -- "TANSTAAFL" Rich lynch@lscorp.com