+ Reply to Thread
Results 1 to 3 of 3

 

Thread: My SQL Join table duplicate problems

  1. #1
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts


    Hi
    I am joining 2 tables using an expression like:
    PHP Code:
    select tbl1.atbl1.btbl1.ctbl2.atbl2.e FROM tbl1tbl2WHERE tbl1.tbl2.AND tbl1.VALUE 
    Due to the nature of the data I am getting duplicate rows.
    Is there a quick SQL method to remove duplicate rows?
    Do I put distinct() round each of the columns?

    Cheers
    Follow Me | Looking for Merchants Who Do Scifi Stuff

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think a distinct around the tbl1a select statement will probably do it.

    select distinct(tbl1.a), tbl1.b, tbl1.c, tbl2.a, tbl2.e FROM tbl1, tbl2 WHERE tbl1.a = tbl2.a AND tbl1.b = VALUE

  3. #3
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts
    Cheers. That appears to work.
    Follow Me | Looking for Merchants Who Do Scifi Stuff

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 28-12-03, 04:46 PM

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2