🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Syntax for SQL INTERSECT and MINUS

#488
From: Steve Koterski
Date: Tue, 08 Dec 1998 00:00
43 lines
2271 bytes
On Mon, 07 Dec 1998 15:51:08 -0800, thall <thall@deltanet.com> wrote:

>What is the syntax to use intersect and minus with Visual dBASE 7.01?

Unless you are asking about pass-through SQL to some database type other
than dBASE or Paradox, forget trying.

While local SQL is a subset of SQL-92 and SQL-92 includes an INTERSECT join
operator, INTERSECT is not part of that subset for local SQL. The MINUS
operator does not appear to be part of SQL-92 at all, and so is not in
local SQL.

For other databases accessed through pass-through SQL, the INTERSECT join
is used just like the UNION join syntax. Two SELECT queries are
concatenated, with the result set being the rows each has in common.

  SELECT *
  FROM OneTable
  INTERSECT
  SELECT *
  FROM AnotherTable

The INTERSECT join also supports ALL and CORRESPONDING BY clauses. The
latter is used to specify the columns in the tables on which to base
commonality of data, rather than on all the columns in the SELECT
statements.

  SELECT *
  FROM OneTable
  INTERSECT
    CORRESPONDING BY (Column1, Column2)
  SELECT *
  FROM AnotherTable

The MINUS statement not being part of SQL-92 and so not in any of my
references, I could not advise.

//////////////////////////////////////////////////////////////////////////
Steve Koterski                 "What is success in this world? I would say
Technical Publications         it consists of four simple things: to live
INPRISE Corporation            a lot, to love a lot, to laugh a lot, and
http://www.inprise.com/delphi  from it all, to learn a lot."
                                                     -- Richard J. Needham
Technical Details
Message-ID: <366c7308.12009952@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <366C69EC.7259D58B@deltanet.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,39faad687666d474
X-Google-Attributes: gidff5a1,public
From: skoterski@NOSPAMinprise.com (Steve Koterski)
Subject: Re: Syntax for SQL INTERSECT and MINUS
Date: 1998/12/08
Message-ID: <366c7308.12009952@forums.inprise.com>
X-Deja-AN: 419843949
Content-Transfer-Encoding: 7bit
References: <366C69EC.7259D58B@deltanet.com>
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