SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict chiefmonkey's Avatar
    Join Date
    Aug 2002
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LETF JOIN perhaps

    I have two tables

    tableOne
    ------------
    id
    user
    imageName
    comments

    tableTwo
    -------------
    picID
    comments

    I need to select the imageName from tableOne and any comments from tableTwo where id = picID

    The problem is if there are let's say there are 5 comments on for an image then the imagename is returned 5 times.

    Thanks
    G
    Got Sig!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by chiefmonkey
    The problem is if there are let's say there are 5 comments on for an image then the imagename is returned 5 times.
    that's not a problem, that's a feature

    that's the way queries work

    if you want to suppress the "repeated" info, you should do that in your scripting language
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •