Subject | Re: Selecting distinct |
---|---|
Author | Adam |
Post date | 2006-12-15T01:47:18Z |
--- In firebird-support@yahoogroups.com, "sasidhardoc"
<madhusasidhar@...> wrote:
Imagine
ID F1 F2
1 1 1
2 1 1
and imagine your desired query syntax existed. It should return
ID F1 F2
?? 1 1
Should it return 1 or 2 in your ID field.
You can use an aggregate if you don't care.
SELECT Min(ID), f1, f2
from ...
group by f1, f2
Adam
<madhusasidhar@...> wrote:
>Your desired query does not make sense.
> For a query such as "SELECT ID, f1, f2 FROM t1......" is it possible
> to return records that have distinct values in some columns only?
> "SELECT DISTINCT ID, f1, f2 FROM t1......" does not work because ID is
> always a distinct value. TIA!
>
Imagine
ID F1 F2
1 1 1
2 1 1
and imagine your desired query syntax existed. It should return
ID F1 F2
?? 1 1
Should it return 1 or 2 in your ID field.
You can use an aggregate if you don't care.
SELECT Min(ID), f1, f2
from ...
group by f1, f2
Adam