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

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -