using || in casewhen

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
royjaydAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SANDY_SKConnect With a Mentor Commented:
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
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
>>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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.