?
Solved

using ||  in casewhen

Posted on 2013-02-04
2
Medium Priority
?
330 Views
Last Modified: 2013-02-04
hi guys
I have two tables

employee table has
Id salary   bonus
1  100       22
2  300        33
5  600

customer table has
Id salary  bonus
1   100     33
2   500      44
5   800

select e.id, case when e.salary != c.salary || e.bonus != c.bonus then 'false' else 'true' end status

getting error
ORA-00905: missing keyword
00905. 00000 -  "missing keyword"

any idea?

thanks
0
Comment
Question by:royjayd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
SANDY_SK earned 1400 total points
ID: 38852290
have you tried using OR instead of ||

select e.id, case when e.salary != c.salary OR e.bonus != c.bonus then 'false' else 'true' end status
0
 
LVL 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 200 total points
ID: 38852309
>>select e.id, case when e.salary != c.salary || e.bonus != c.bonus then 'false' else 'true' end status


'||' is a string concatination.  I think you want 'or' here.

select e.id, case when e.salary != c.salary or e.bonus != c.bonus then 'false' else 'true' end status
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question