Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Two JOINs in SQL

Two JOINs in SQL

Scheduled Pinned Locked Moved C#
databasehelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    My select statement looks like this: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; When I execute ExecuteReader() I' getting an error. With only first join it's OK, with only second join it's OK but with joins there is exception. Is this syntax incorrect for two joins? Jerzy :confused:

    C 1 Reply Last reply
    0
    • L Lost User

      My select statement looks like this: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; When I execute ExecuteReader() I' getting an error. With only first join it's OK, with only second join it's OK but with joins there is exception. Is this syntax incorrect for two joins? Jerzy :confused:

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      JerzyPeter wrote: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; string str="select t1.amt,t2.Name,t3.Desc from (t1 left join t2 on t2.ID=t1.ID)left join t3 on t3.ID=t2.ID";;) Best Regards Carlos Antollini. Sonork ID 100.10529 cantollini

      L 1 Reply Last reply
      0
      • C Carlos Antollini

        JerzyPeter wrote: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; string str="select t1.amt,t2.Name,t3.Desc from (t1 left join t2 on t2.ID=t1.ID)left join t3 on t3.ID=t2.ID";;) Best Regards Carlos Antollini. Sonork ID 100.10529 cantollini

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks a lot!!! Jerzy:)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups