> I need a control break flag in my result when a certain value is
> different to the previous.
[quoted text clipped - 12 lines]
>
> Bernd
select
producer,
article,
case when rn = 1 then 1 else 0 end as flag
from
(select
producer,
article,
rownumber() over (partition by producer order by article) as rn
from
yourtable) as x;
Bernd Hohmann - 18 Apr 2006 12:44 GMT
>> any ideas?
>
[quoted text clipped - 9 lines]
> from
> yourtable) as x;
Thanks a lot. I was able to compress this a little bit into
case when (rownumber() over (partition by producer order by article ))=1
then 1 else 0 end as cbflag
without the additional select (don't know why it works, SQL is sometimes
a mystery to me).
Bernd