注册 登录
编程论坛 SQL Server论坛

Conditional Update of a field from multiple tables

bobojin 发布于 2015-09-09 15:45, 1042 次点击

Dear all,

I have a target table with two fields: Date and ID

There three source tables: S1, S2, S3, each of them has three fields: Date, ID, and Score

Now I want to update the target table: put the ID into the ID field which has the highest Score from the three tables on each day.

Could anyone kindly help me or give me some hints? Thanks

2 回复
#2
kinvanhon2015-09-09 17:48
your question is not very clear,you'd better describe it in detail and provide some example data.
the highest Score from three tables on each day,is the day in each table or all of tables?
is the field "ID" primary key or just an id?
#3
tlliqi2015-09-09 21:03
E文不好
1