sql server 2005 - Inserting Column From Into Another Table Trough Query -


how update range field of of table below

enter image description here

(don't mind '1' values range above, it's supposed null)

with range values of table below

enter image description here

when inner join table other on equipmentcode values doubled this: enter image description here

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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -