Re: How to: Remove duplicate TITLES but keep a COUNTRY code

From: leetrainer (leetrainer_at_discussions.microsoft.com)
Date: 06/15/04


Date: Tue, 15 Jun 2004 14:53:01 -0700

Hi Joel
Thanks for the quick response. Problem here is that I only get the two fields in the table TITLE, ORIGIN and lose the rest. Any other suggestion?

Lee....

"Joel" wrote:

> Take advantage of the fact that USA is alphabetically the MAX value:
>
> Select TITLE, Max(Origin) From Table Group by Title
>
> If there is no USA in one of the choices, you get the highest one available
> alphabetically.
>
> "leetrainer" <leetrainer@discussions.microsoft.com> wrote in message
> news:FC3B6A2A-A98B-4978-8BA9-553B8A97A00A@microsoft.com...
> > Hi all
> >
> > I'm trying to find out how to Retrieve Data from a Single Table and was
> wondering if someone could help with the following as I cant seem to find
> the answer to what is probably an easy question for the experts. I'm a
> Visual FoxPro 6 user and use the following code to almost accomplish what
> I'm after...
> >
> > SELECT * FROM mytabletemp INTO TABLE LISTINGS GROUP BY TITLE
> >
> > This works perfectly and removes any duplicate entries with the same TITLE
> >
> > My problem (and yes it's been a problem!) is that I have four possible
> country of ORIGIN codes such EEC - USA - CAN - DOM
> >
> > When you issue the above command it does remove duplicates but keeps a
> country of ORIGIN such as EEC.
> >
> > What I'm trying to do is search out any duplicate TITLES as shown below
> but keep the USA ones
> > Example:
> >
> > ADAMS, BRYAN - BEST OF - EEC
> > ADAMS, BRYAN - BEST OF - USA
> > ADAMS, BRYAN - BEST OF - CAN
> > ADAMS, BRYAN - BEST OF - DOM
> >
> > I did try:
> > SELECT * FROM mytabletemp INTO TABLE LISTINGS GROUP BY TITLE WHERE
> ORIGIN="USA"
> >
> > but this removes all other ORIGIN such as CAN EEC etc
> >
> > So, how do I remove three of the above just keeping the USA title?
> >
> > I would be more than grateful if anyone can suggest the answer
> > Kindest regards
> > Lee
>
>
>



Relevant Pages

  • Re: Simple error message for duplicate records
    ... open the form in Design view. ... Private Sub Form_Error(DataErr As Integer, Response As Integer) ... duplicate value. ...
    (microsoft.public.access.forms)
  • Re: Problem trying to trap error in AfterUpdate event
    ... If it's a duplicate, the code goes to the error handling section, but it ... Private Sub Last_Name_AfterUpdate ... Dim DataErr As Integer ... Dim Response As Integer ...
    (microsoft.public.access.formscoding)
  • Re: Errors in wintrust.dll
    ... Thank you for your response and please accept my apologies for the duplicate ... >> installing the second time, I began receiving messages saying that stmgr, ... when I use the System Utility and click ...
    (microsoft.public.windowsupdate)
  • Re: How to: Remove duplicate TITLES but keep a COUNTRY code
    ... > SELECT * FROM mytabletemp INTO TABLE LISTINGS GROUP BY TITLE ... > This works perfectly and removes any duplicate entries with the same TITLE ... country of ORIGIN codes such EEC - USA - CAN - DOM ...
    (microsoft.public.sqlserver.programming)
  • Re: 25,000 resources created - out of memory
    ... I received a response back from Microsoft referencing this as a known issue. ... references the issue of creating duplicate resources and states that the ... 890073 PSRV2003: RFH: Local Resources automatically duplicated creating very ...
    (microsoft.public.project.pro_and_server)