SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with sql?

    I'm using the following sql statement on an Postgresql 7.4 database. But none of the joined info is showing from tbl98 and tbl99. If I remove the
    AND tbl97.col22=0 AND tbl98.col22=0
    AND tbl99.col22=0 AND tbl98.col22=0
    from the join statements it shows all the records fine. I've double checked all the col22 in all three tables and they all equal 0. So I'm not sure why they're not showing up.

    SELECT
    tbl97.col3,
    tbl98.col3,
    tbl99.col3
    FROM (tbl97
    LEFT JOIN tbl98 ON tbl97.col1 = tbl98.col2 AND tbl97.col22=0 AND tbl98.col22=0)
    LEFT JOIN tbl99 ON tbl98.col1 = tbl99.col2 AND tbl99.col22=0 AND tbl98.col22=0
    ORDER BY
    tbl97.col3,
    tbl98.col3,
    tbl99.col3

  2. #2
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, i think it's working fine. I just had to reload some code.


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
  •