🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.intrabuilder.data.sql
Article #74

SQL Sorting

#74
From: DC
Date: Tue, 09 Jun 1998 00:00
19 lines
1214 bytes
If you have a table which contains info on people. For Example:

PersonTable (Table Name)
Name, Hair_Color and  Eye_Color (Fields)

How would I write a SELECT query to search for people whos name is "TED" has
"BROWN" hair and "GREEN" eyes? I want to return records sorted by bestmatch.
ie. Records that contain all three of the search criteria, then records that
contain "TED" and "BROWN" hair, then records that contain "TED"
and "GREEN" eyes, and so on.

AND searches would simply omit records that didn't contain all three and an
OR search would return all records with any of the criteria, but not in
order of relevance.
I asked this question once before here, but no-one had a detail answer. I
know what needs to be done, just not how to word it in SQL.

-Derek
Technical Details
Message-ID: <6lkmcl$7rm7@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 101d9a,6e90a44b7b671cbd,start
X-Google-Attributes: gid101d9a,public
From: "DC" <DerCribbs@aol.com>
Subject: SQL Sorting
Date: 1998/06/09
Message-ID: <6lkmcl$7rm7@forums.borland.com>
X-Deja-AN: 361205302
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.intrabuilder.data.sql