sql server - SQL Select Top and Random Fill -


i select , insert top 4650 fields table column g table b column e. how can randomly fill column data table column g? how replace data exist in column e? easier in multiple parts?

if single column should work you.

insert tableb (columne) select top(4650) columng tablea 

if there relationship between tables this

update x set columne = y.columng  tableb x inner join (select top(4650) id tablea) y on x.id = y.id 

you utilize cte

;with  (    select top (4650) id,columng     tablea ) y  update x set columne = y.columng tableb x inner join y on x.id = y.id 

we need structure of tables answer question


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -