🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.database
Article #132

Re: outer joins

#132
From: David St. Pierre
Date: Sun, 25 Aug 1985 18:47
22 lines
1163 bytes
I'll borrow the example from the ORACLE manual:

"List all departments that have employees, plus those departments
that do not have employees"

SELECT dept.deptno, dname, job, ename
	from	dept, emp
	where	dept.deptno = emp.deptno(+)
	order	by dept.deptno;


Also:

"List all departments that do not have any employees"

SELECT distinct dept.deptno, dname, koc
	from	dept, emp
	where	dept.deptno = emp.deptno(+)
	  and	empno is null;
-- 
David St. Pierre		{ihnp4,dual,qantel}!ptsfa!dsp
Technical Details
Message-ID: <824@ptsfa.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!well!ptsfa!dsp
References: <450@im4u.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ptsfa.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!well!ptsfa!dsp
From: dsp@ptsfa.UUCP (David St. Pierre)
Newsgroups: net.database
Subject: Re: outer joins
Message-ID: <824@ptsfa.UUCP>
Date: Sun, 25-Aug-85 14:47:35 EDT
Article-I.D.: ptsfa.824
Posted: Sun Aug 25 14:47:35 1985
Date-Received: Wed, 28-Aug-85 21:11:35 EDT
References: <450@im4u.UUCP>
Reply-To: dsp@ptsfa.UUCP (David St. Pierre-150)
Distribution: net
Organization: Pacific Bell, San Francisco
Lines: 22