jteixeira Posted November 20, 2006 Share Posted November 20, 2006 Hello I Have 2 Tables:Infofin_prodid Infoid Maquinaid idprod salesProd cashprod5861 203 05BV02000230 bq0001 25 5,005862 203 05BV02000230 bq0003 8 1,605863 203 05BV02000230 bq0005 2 0,405864 203 05BV02000230 bq0007 2 0,505865 203 05BV02000230 bq0009 3 0,75InfoFinanceirainfoid Maquinaid Sumcash Sumprod203 05BV02000230 13,15 181204 05BV02000230 0,00 1205 05BV02000230 0,20 3206 05BV02000230 0,75 6207 05BV02000230 0,25 3I want update all the column of InFoFinanceira with the sum of salesprod values per infoid Link to comment Share on other sites More sharing options...
justsomeguy Posted November 20, 2006 Share Posted November 20, 2006 UPDATE InfoFinanceira SET Sumprod = (SELECT SUM(salesProd) FROM infofin_prod WHERE infofin_prod.infoid=InfoFinanceira.infoid)That might work. Link to comment Share on other sites More sharing options...
jteixeira Posted November 21, 2006 Author Share Posted November 21, 2006 doesn't work, this apply all tables with the same value Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now