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 |
|
FabioEinaus
Starting Member
41 Posts |
Posted - 2006-12-11 : 11:35:13
|
Hi ppl!I'd like to update the Consumido and ConsumidoHR fields with the sum of the Custo and Horas, on a Tarefa and ProjectID. (view the picture to see what i'm talking) I want to do what i wrote on the pic but on all the Rows on ProjectosTrabalhosCan someone help me? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-11 : 13:31:10
|
| update xset x.consumido = q.aa,x.consumidohr = q.bbfrom projectostarefas as xinner join (select projecid, tarefa, sum(custo) as aa, sum(horas) as bb from ProjectosTrabalhos group by projecid, tarefa) q on q.projectid = x.projectid and q.tarefa = x.tarefaPeter LarssonHelsingborg, Sweden |
 |
|
|
FabioEinaus
Starting Member
41 Posts |
Posted - 2006-12-12 : 07:43:49
|
Thanks for the reply!It works!thank you!You are awesome |
 |
|
|
|
|
|