Holy smokes. Are... are those S/36 environment files? It looks like they are externally described. I thought S/36 env. files were all flat files. #distantmemory

- Dan Bale

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of K Crawford
Sent: Tuesday, May 13, 2025 10:24 AM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: SQL join, limit to one row per employee

I have an SQL doing an inner join between two tables.
The results have two rows for some employees, due to one table having two 'active' rows for that employee.
How can I write my SQL to only have one row for that employee?
This is my SQL.
SELECT em.*
FROM qs36f.v@ep_0 as ep
inner join qs36f.v@em_0 as em
on em.client = ep.client and em.rnum = ep.rnum and em.enum = ep.employee#
<snip>
*** CONFIDENTIALITY NOTICE: The information contained in this communication may be confidential, and is intended only for the use of the recipients named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender. ***

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.