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. Database & SysAdmin
  3. Database
  4. Right outer join with no ON

Right outer join with no ON

Scheduled Pinned Locked Moved Database
databasedebugginghelp
4 Posts 3 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.
  • V Offline
    V Offline
    vkEE
    wrote on last edited by
    #1

    Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:

    select
    *
    from
    a inner join b on a.id=b.id
    inner join c on a.id=c.id
    right outer join e
    inner join f on e.id = f.id

    Strange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!

    P M 2 Replies Last reply
    0
    • V vkEE

      Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:

      select
      *
      from
      a inner join b on a.id=b.id
      inner join c on a.id=c.id
      right outer join e
      inner join f on e.id = f.id

      Strange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      No idea, but which database system?

      1 Reply Last reply
      0
      • V vkEE

        Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:

        select
        *
        from
        a inner join b on a.id=b.id
        inner join c on a.id=c.id
        right outer join e
        inner join f on e.id = f.id

        Strange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Assumption is that you are using SQL Server! I often see this when using the query designer to create a view, I think it means e is not used in the data but is required get to f so the query builder simply does the join in this fashion. I ALWAYS break this out and create the additional joins through to f, it is more understandable. Caveat This may be completely wrong (I never bothered to investigate the issue) and is probably technically incorrect but it is more readable.

        Never underestimate the power of human stupidity RAH

        P 1 Reply Last reply
        0
        • M Mycroft Holmes

          Assumption is that you are using SQL Server! I often see this when using the query designer to create a view, I think it means e is not used in the data but is required get to f so the query builder simply does the join in this fashion. I ALWAYS break this out and create the additional joins through to f, it is more understandable. Caveat This may be completely wrong (I never bothered to investigate the issue) and is probably technically incorrect but it is more readable.

          Never underestimate the power of human stupidity RAH

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Mycroft Holmes wrote:

          the query designer

          Blech, filth. X|

          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