Guys,
Need help with updating a table.
My table contains data as follows (primary key : EQUIP & JOBID)
EQUI JOBID RDate Prior_JOBID
XXX1 SSS1 1/1/2010
XXX1 PPP1 2/2/2009
XXX1 YYY1 1/1/2007
YYY1 HHH1 2/2/2011
YYY1 QQQ1 3/3/2010
YYY1 UUU1 4/4/2009
YYY1 TTT1 1/1/2008
I want to write an update statement that will grab the prior JOBID of each record based on RDate and will update the table in following manner:
EQUI JOBID RDate Prior_JOBID
XXX1 SSS1 1/1/2010 PPP1
XXX1 PPP1 2/2/2009 YYY1
XXX1 YYY1 1/1/2007
YYY1 HHH1 2/2/2011 QQQ1
YYY1 QQQ1 3/3/2010 UUU1
YYY1 UUU1 4/4/2009 TTT1
YYY1 TTT1 1/1/2008
thx.
Al
Need help with updating a table.
My table contains data as follows (primary key : EQUIP & JOBID)
EQUI JOBID RDate Prior_JOBID
XXX1 SSS1 1/1/2010
XXX1 PPP1 2/2/2009
XXX1 YYY1 1/1/2007
YYY1 HHH1 2/2/2011
YYY1 QQQ1 3/3/2010
YYY1 UUU1 4/4/2009
YYY1 TTT1 1/1/2008
I want to write an update statement that will grab the prior JOBID of each record based on RDate and will update the table in following manner:
EQUI JOBID RDate Prior_JOBID
XXX1 SSS1 1/1/2010 PPP1
XXX1 PPP1 2/2/2009 YYY1
XXX1 YYY1 1/1/2007
YYY1 HHH1 2/2/2011 QQQ1
YYY1 QQQ1 3/3/2010 UUU1
YYY1 UUU1 4/4/2009 TTT1
YYY1 TTT1 1/1/2008
thx.
Al