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. Older generation SQL syntax - Oracle

Older generation SQL syntax - Oracle

Scheduled Pinned Locked Moved Database
helpdatabaseoraclequestion
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
    vanikanc
    wrote on last edited by
    #1

    Hi - I have having a join issue. we have report which was set up a while ago, needs to be modified. I have to add one more table, using a LEFT OUTER JOIN but using (+)! I need to left outer join table B to table A, but it is a substring. I tried which made sense syntax wise -

    substr(A.source,1,4)=substr(B.OFFERNO,1,4)(+)

    which did not work. Below syntax did not error out - does this look right?

    substr(A.source,1,4)=substr(B.OFFERNO(+),1,4)

    J 1 Reply Last reply
    0
    • V vanikanc

      Hi - I have having a join issue. we have report which was set up a while ago, needs to be modified. I have to add one more table, using a LEFT OUTER JOIN but using (+)! I need to left outer join table B to table A, but it is a substring. I tried which made sense syntax wise -

      substr(A.source,1,4)=substr(B.OFFERNO,1,4)(+)

      which did not work. Below syntax did not error out - does this look right?

      substr(A.source,1,4)=substr(B.OFFERNO(+),1,4)

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      From the Oracle language reference: The (+) operator can be applied only to a column, not to an arbitrary expression. However, an arbitrary expression can contain one or more columns marked with the (+) operator. So the second syntax looks valid to me. Does it give you the expected results?

      "The ones who care enough to do it right care too much to compromise." Matthew Faithfull

      V 1 Reply Last reply
      0
      • J Jorgen Andersson

        From the Oracle language reference: The (+) operator can be applied only to a column, not to an arbitrary expression. However, an arbitrary expression can contain one or more columns marked with the (+) operator. So the second syntax looks valid to me. Does it give you the expected results?

        "The ones who care enough to do it right care too much to compromise." Matthew Faithfull

        V Offline
        V Offline
        vanikanc
        wrote on last edited by
        #3

        You are right. The second one worked for me. Thank you!

        L 1 Reply Last reply
        0
        • V vanikanc

          You are right. The second one worked for me. Thank you!

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

          If this is still confusing, you can create a view with the expression and then do your join on the view.

          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