🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #912

SELECT MIN

#912
From: aleplgr
Date: Wed, 18 Apr 2007 11:20
8 lines
1143 bytes
Hi! I have a 3 columns table: CLIENTID DATE1 DATE2
for each CLIENTID can be more than one DATE1 so I have to select the MIN. Just doing this works fine:
SELECT MIN (DATE1)
from mytable
group by CLIENTID

Now I need also to show DATE2 in the result table, if I include it in the SELECT I need to include  it in the GROUP BY but if I do that I don't get the MIN(DATE1)for each CLIENTID: it returns all of them.. 
Technical Details
Message-ID: <4625f0e8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,ef167041b2966043,start
X-Google-Attributes: gid114a0e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "aleplgr" <aleplgr@yahoo.es>
Sender: "aleplgr" <aleplgr@yahoo.es>
Reply-To: "aleplgr" <aleplgr@yahoo.es>
Subject: SELECT MIN 
Newsgroups: borland.public.interbase.sql
X-User-Info: 80.58.205.38     
X-Forwarded-For: 80.25.195.180, 192.168.1.66
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4625f0e8@newsgroups.borland.com>
Date: 18 Apr 2007 03:20:24 -0800
X-Trace: newsgroups.borland.com 1176891624 207.105.83.66 (18 Apr 2007 03:20:24 -0800)
Lines: 9
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail