• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Decode

 
santhosh kumar vk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please tell me how the + operator will work in oracle decode for example

WHERE pc.catg_c = DECODE(ml.catg_c (+), 'A', 'B', 'C', 'D')

please tell me what is the use of + operator in decode.

Thanks,
Santhosh Kumar VK
 
chris webster
Bartender
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the "(+)" appear in other parts of your WHERE clause or the tables in your FROM clause? It looks like an outer join condition to me.
 
santhosh kumar vk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reply

Which is in WHERE Class, Could you please tell me is there any differenct using the (+) operator in WHERE clause and FROM clause and then
How it will work in DECODE Function.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh kumar vk wrote: Could you please tell me is there any differenct using the (+) operator in WHERE clause and FROM clause

As far as I know, the (+) cannot be used in the FROM clause.

How it will work in DECODE Function.

As Chris has already mentioned, this probably indicates an outer join. I guess that lines from the pc table will be included, even if there isn't a record in the ml table such that the DECODE expression would match pc.catg_c.

It would be much more readable when converted to ANSI join syntax, in my opinion.
 
santhosh kumar vk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you for reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic