Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    15

    Unanswered: Select duplicate records from the same table

    Hi,
    I have two tables wih the same schema structure.
    Like:

    Old Table
    Name
    Location

    New table
    Name
    Location

    New table has some records with the same Name but differenct Locaiton to Old table

    Like this :
    old
    Name: John Location: Paris
    Name: John Location: New York

    new
    Name: John Location: Paris
    Name: John Loctation: London


    How can I choose "London" record from New table? (There might be several "John" records in both table)

    I'm trapped in this Query Syntax for all noon..Doe JOIN work to solve this?

    thanks for the help in advance.

    tienchihwang

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    Whoops!
    You have two posts with different data.

    I suggest you remove the other post and keep this one.

    The outer join should still work ...

    try this:
    PHP Code:
    select 
    new.name
    --
    old.name
    new.
    location
    from 
    new_table 
    new,
    old_table old
    where 
    new.name old.name(+) and 
    new.
    location old.location(+) and
    old.location is null
    Last edited by The_Duck; 08-28-03 at 17:41.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Feb 2002
    Posts
    15
    It works!!!!!
    Thanks for the help .... I do appreciate it....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •