Hello:
I have a query that I wrote in MS SQl 7.0 when I transfered to Sybase it has a big problem with the case statement for some reason it does not like the "AND" is this a restriction in Sybase? Here is the sample Query:
select m. policy_id, ExRtCd=
case when count(distinct m.state_id) > 1 and
when count(distinct m.action_code_adj_value_input) > 1 then '3'
into #ExRtCd_res1
from wcps.period_action_code as m
group by m.policy_id;
This query works fine in MS Sql 7.0 on Sybase it has a problem with the AND. I can comment out the second count and it will run?? Any ideas are welcomed?
I have a query that I wrote in MS SQl 7.0 when I transfered to Sybase it has a big problem with the case statement for some reason it does not like the "AND" is this a restriction in Sybase? Here is the sample Query:
select m. policy_id, ExRtCd=
case when count(distinct m.state_id) > 1 and
when count(distinct m.action_code_adj_value_input) > 1 then '3'
into #ExRtCd_res1
from wcps.period_action_code as m
group by m.policy_id;
This query works fine in MS Sql 7.0 on Sybase it has a problem with the AND. I can comment out the second count and it will run?? Any ideas are welcomed?