Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlServer To Oracle
Message
General information
Forum:
Oracle
Category:
PL/SQL
Miscellaneous
Thread ID:
00678818
Message ID:
00678989
Views:
19
My quess is you get ORA-01722 because you can't sum on a Char column as shown in the below example:

SQL> select sum(case when 1=1 then 'hello' end) from dual;
select sum(case when 1=1 then 'hello' end) from dual
*
ERROR at line 1:
ORA-01722: invalid number


SQL> select sum(case when 1=1 then 1 end) from dual;

SUM(CASEWHEN1=1THEN1END)
------------------------
1


So in your case try:
sum(case when z = 123 and y = 432 then 1 end) as SomeTotal

This doesn't make any sense but I assume you are just testing at the moment
or something?!! Cause it only makes sense to some a column as in:

sum(case when col1 = 123 and col2 = 432 then sumcol end) as SomeTotal


>sum( case
> when z = 123 and y = 432
> then 'hello World'
> end) as SomeTotal
>
>So I guess my question is How can I get around this?
>Thanks in advance
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform