Article View: borland.public.interbase.sql
Article #920Re: Same line SELECT MIN
From: Karol Bieniaszewski
Date: Tue, 24 Apr 2007 10:40
Date: Tue, 24 Apr 2007 10:40
24 lines
1631 bytes
1631 bytes
U�ytkownik "aleplgr" <aleplgr@yahoo.es> napisa� w wiadomo�ci news:462dca7d$1@newsgroups.borland.com... > > Hi, I have this problem: my table is > PATIENTID, DATE, DIFF > > for each PATIENTID can be many DATE and many DIFF, DIFF is an integer and > I need for each PATIENTID the MIN DIFF and the DATE of the same line where > MIN(DIFF) is. > > I did this: but it's not working > > SELECT PATIENTID,DATE,DIFF FROM T MYTABLE > WHERE DIFF = (SELECT MIN(DIFF) FROM Q MYTABLE > WHERE (T.PATIENTID = Q.PATIENTID > AND T.DATE = Q.DATE ) > Is this Interbase? In Interbase alias is after table name. And what errror do you get? Karol Bieniaszewski
Technical Details
Message-ID:
<462dddcb$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<462dca7d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,67140aa9ee91b46d X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII From: "Karol Bieniaszewski" <liviuslivius@poczta.onet.pl> Newsgroups: borland.public.interbase.sql References: <462dca7d$1@newsgroups.borland.com> Subject: Re: Same line SELECT MIN Date: Tue, 24 Apr 2007 12:40:43 +0200 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 NNTP-Posting-Host: 195.205.151.58 Message-ID: <462dddcb$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1177411019 195.205.151.58 (24 Apr 2007 03:36:59 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail