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

From: Prasad Koukuntla (prasad.koukuntla_at_scapromo.com)
Date: 06/15/04


Date: Tue, 15 Jun 2004 16:51:01 -0500

Please provide the table schema and sample data.

"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: 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: Violation of Primary Key
    ... Maybe you could post your DML and sample data to reproduce the problem? ... You're trying to insert a duplicate ... making changes and I receive an error that says the following: ... > Violation of PRIMARY KEY constraint 'PK_CUSTOMERS'. ...
    (microsoft.public.sqlserver.server)
  • Re: How to: Remove duplicate TITLES but keep a COUNTRY code
    ... Thanks for the quick response. ... Any other suggestion? ... >> This works perfectly and removes any duplicate entries with the same TITLE ... > country of ORIGIN such as EEC. ...
    (microsoft.public.sqlserver.programming)
  • Re: Finding duplicate names
    ... Assuming the data in cols A and B are in row1 down ... For the sample data in your post ... Jack Black..Not a Duplicate ...
    (microsoft.public.excel.misc)
  • Re: Deleting duplicate records based on lowest number
    ... > Can some one assist with deleting duplicate records based on lowest ... all occurences of a duplicate F1 value. ... Sample Data ... FROM tblDUP AS D0 ...
    (microsoft.public.access.gettingstarted)