pcgm
SSC Rookie
Points: 44
More actions
June 22, 2010 at 12:23 am
#1183093
Got it. Thanks
Eralper (6/21/2010)Hi pcgm,My code responds to changes in modelIf you want to respond to changes in value column please change the WHERE clause as followst1.value <> t2.value --t1.model <> t2.modelI meanwith cte as ( select *, rn = ROW_NUMBER() OVER (Order By Id) from FindChanges)select t1.*, t2.*from cte t1full join cte t2 on t1.rn = t2.rn + 1where t1.value <> t2.valueI hope I'm not missing something too.
Eralper (6/21/2010)
My code responds to changes in model
If you want to respond to changes in value column please change the WHERE clause as follows
t1.value <> t2.value --t1.model <> t2.model
I mean
with cte as (
select *, rn = ROW_NUMBER() OVER (Order By Id) from FindChanges
)
select t1.*, t2.*
from cte t1
full join cte t2 on t1.rn = t2.rn + 1
where t1.value <> t2.value
I hope I'm not missing something too.
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply