Replace one column by values of the same column in anther table in SQL server -


i have 2 tables, 1 big , 1 small. both contain columns id , effectivedate.

the bigger table has more other columns , of course more rows smaller table.

under condition id both tables same, effectivedate column earlier in small table big table. want replace effectivedate in big table value of effectivedate column small table.

what should do?

seems very basic sql query....

update bt set effectivedate = st.effectivedate dbo.biggertable bt inner join dbo.smallertable st on bt.id = st.id -- maybe need condition, if not *all* effectivedate values in  -- smaller table indeed before values in bigger table st.effectivedate < bt.effectivedate 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -