sql server 2005 - Inserting Column From Into Another Table Trough Query -
how update range field of of table below

(don't mind '1' values range above, it's supposed null)
with range values of table below

when inner join table other on equipmentcode values doubled this: 
this query used:
select c.*, r.range rangefromothertable equipmentcalibrationref c inner join range r on r.equipmentcode = c.equipmentcode
as start, can use following statement pseudo 1 1 match
select ecr.*, r.[range] equipmentcalibrationref ecr inner join ( select refno = row_number() on (partition equipmentcode order [range]), * [range] r ) r on r.refno = ecr.refno , r.equipmentcode = c.equipmentcode
Comments
Post a Comment