Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

using ||  in casewhen

Posted on 2013-02-04
2
Medium Priority
?
331 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

636 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