Re: Disregard duplicates based on a field




mBird wrote:
I have a table with three fields:
f1, f2, f3
1 a 432
2 b 323
3 a 345 <-- so 3 has an a and b entry
3 b 345 <-- so 3 has an a and b entry

I need all the distinct f1's but when choosing which of the duplicates to
keep be able to specify the priority choice of f2 being a. So...
-if there is only one distinct f1 then I want that row regardless of f2
-if there are multiple rows with the same f1's then I want the one that f2 =
a
1 a 432
2 b 323
3 a 345
(notice I kept 3 a 345 but discarded 3 b 345)

Thank you!

what's wrong with:

select f1, MIN(f2), f3 from yourtable
group by f1,f3;

???

.



Relevant Pages

  • Re: A reply to Marvin Minsky.
    ... and not over specify the behavior. ... abstractions based on internal implementations over specify. ... period, and then you build a machine that duplicates the behavior, haven't ... It is the interanl ...
    (comp.ai.philosophy)
  • Re: Help with ALTER TABLE statement
    ... Allen Browne wrote: ... Is that a constraint? ... an allow duplicates index/constraint just doesn't ... specify the UNIQUE option. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Remove Duplicates
    ... In Options, specify that Global is Unique, always validate. ... Create a new script. ... Set Error Capture ... exclamation point, for duplicates. ...
    (comp.databases.filemaker)
  • Re: Remove Duplicates
    ... In Options, specify that Global is Unique, always validate. ... Create a new script. ... Set Error Capture ... exclamation point, for duplicates. ...
    (comp.databases.filemaker)
  • Re: Insert related fields
    ... You can do this by going to Define Database, choosing the the ... Description field in Purchase Order and checkboxing Looked-up value and ... specify Description from Sources. ...
    (comp.databases.filemaker)