Subject | Re: Selecting distinct |
---|---|
Author | Adam |
Post date | 2006-12-15T07:30:13Z |
--- In firebird-support@yahoogroups.com, "sasidhardoc"
<madhusasidhar@...> wrote:
Select distinct f2 from T...
For every record with a given f2 there may be multiple records with
different f1 values, so if you include f1 in your select of course you
will have duplicates.
F1 F2
-- ---
1 Foo
2 Foo
3 Bar
Sure you want to get
F2
---
Foo
Bar
But how is Firebird supposed to return F1 when the first record could
possible be two values?
Adam
<madhusasidhar@...> wrote:
>Then select distinct last names only.
> ID is a field ... example "Select f1, f2 from T..." where F1 is an ID
> field. Let's say F2 is Last Name. I want to select distinct last names
> only.
>
Select distinct f2 from T...
For every record with a given f2 there may be multiple records with
different f1 values, so if you include f1 in your select of course you
will have duplicates.
F1 F2
-- ---
1 Foo
2 Foo
3 Bar
Sure you want to get
F2
---
Foo
Bar
But how is Firebird supposed to return F1 when the first record could
possible be two values?
Adam