Subject | Re: [firebird-support] Re: Distinct |
---|---|
Author | Arno Brinkman |
Post date | 2003-10-30T16:28:37Z |
Hi,
SELECT
t1.FIELD1,
MAX(t1.FIELD2)
FROM
TBL1 t1
GROUP BY
t1.FIELD1
or use MIN(t1.FIELD2)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> Thanks Milan,Is this what you want :
> But unfortunately this is not I'd like.
>
> There are 4 possibilities:
> I.
> FIELD1, FIELD2
> 1,1
> 2,2
>
> II.
> FIELD1, FIELD2
> 1,2
> 2,2
>
> III.
> FIELD1, FIELD2
> 1,1
> 2,1
>
> IV.
> FIELD1, FIELD2
> 1,2
> 2,1
>
> In fact I'd like to get one of these, but I don't know how.
SELECT
t1.FIELD1,
MAX(t1.FIELD2)
FROM
TBL1 t1
GROUP BY
t1.FIELD1
or use MIN(t1.FIELD2)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81