🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #139

Re: How to SQL linking 1 to 1 between tables

#139
From: Steve Koterski
Date: Thu, 21 Jan 1999 00:00
34 lines
2338 bytes
On 21 Jan 1999 07:14:18 GMT, "RH" <s_ang@hotmail.com> wrote:

>I am beginner in SQL statment
>How to SQL linking 1 to 1 between tables ??
>Normally, it is 1 to many rowsets, but I want to use the frist rowset only
>if the field is matched.
>However, I try to use SQL comman DISTINCT , it is limited to SELECE field
>only 
>so that I can't use other field in the same rowset .

This is the expected behavior -- in the SQL in general, not just the SQL
you use with dBASE. SQL is by nature set-based and not record-based. That
is, conditions that filter the data from a table can only apply to whole
sets of rows and not to individual records. This is true even if a
condition uniquely identifies a single row: you merely have a set of one
row.

And, yes, the DISTINCT keyword applies to all of the columns (aka fields)
in the SELECT clause of a query.

What you might need to do is exectute your query to retrieve all the rows
(aka records) from the table that meet your specific criteria. Then, use
Visual dBASE facilities to retrieve from that result set and operate on
only the first row of the query's result set. I cannot explain the names of
or usage for these dBASE-specific facilities, but the emminent members of
TeamB here in the newsgroup can. If you need help that is specific to SQL,
though, I might be able to advise; posting responses to questions posted to
the newsgroup.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                       "For people who like peace and quiet:
Technical Publications               a phoneless cord."
INPRISE Corporation                                             -- Unknown
http://www.inprise.com/delphi
Technical Details
Message-ID: <36ac65d9.3525650@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01be450f$6e451640$e41c4dca@remote>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,f972f89b4dbbce0e
X-Google-Attributes: gidff5a1,public
From: skoterski@NOSPAMinprise.com (Steve Koterski)
Subject: Re: How to SQL linking 1 to 1 between tables
Date: 1999/01/21
Message-ID: <36ac65d9.3525650@forums.inprise.com>
X-Deja-AN: 435294230
Content-Transfer-Encoding: 7bit
References: <01be450f$6e451640$e41c4dca@remote>
Content-Type: text/plain; charset=us-ascii
Organization: INPRISE Corporation, Technical Publications
Mime-Version: 1.0
Reply-To: skoterski@NOSPAMinprise.com
Newsgroups: borland.public.vdbase.data.sql