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 |
|
shan1430
Yak Posting Veteran
86 Posts |
Posted - 2008-06-19 : 02:18:25
|
| Hi,I have 5 columns in a table called B. 2 of it is Time and User.how do i add the all the time for an user and insert it into a table called C with columns User and Totaltime? For example,Table BTime......User0.2........A0.2........A0.3........B0.4........Bso my table C should be as follows,Table CUser....TotaltimeA...........0.4B...........0.7 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-19 : 02:20:23
|
| [code]INSERT INTO C (User,TotalTime)SELECT User,SUM(Time)FROM BGROUP BY User[/code] |
 |
|
|
shan1430
Yak Posting Veteran
86 Posts |
Posted - 2008-06-19 : 02:34:45
|
| thanks |
 |
|
|
|
|
|