Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dinzg
Starting Member
6 Posts |
Posted - 2005-02-12 : 17:40:50
|
I have Table: players and Query: yearsQuery: years counts age of players and now I want to insert age from query into players (table)can someone help me?players:ID surname yearofbirth----------------------andyears:ID surname age---------------------- |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-02-12 : 18:49:36
|
will this do?update t1set YearOfBirth = year(getdate()) - t2.age -- i assumed this is what you want based on column namesfrom players t1inner join years t2 on t1.id = t2.id and t1.surname=t2.surnameGo with the flow & have fun! Else fight the flow |
 |
|
dinzg
Starting Member
6 Posts |
Posted - 2005-02-15 : 07:41:03
|
I made it with this one:UPDATE players INNER JOIN years ON [players].[ID]=[years].[ID] SET players.age = [years].[age];thanks for help |
 |
|
|
|
|