Wednesday, 18 September 2013

How to get value from another table and count it

How to get value from another table and count it

This is like a voting system, lets says i have 2 mysql tables,
firsttable
Name Gold
Rafael 1
Fabio 1
Rooney 1
secondtable
Club Golds
Manutd 0
Madrid 0
Barcelona 0
what the sql query to update madrid golds with rafael's gold, so rafael's
gold will be 0 and madrid's golds will be 1. And then if fabio and rooney
give their gold to madrid also, madrid's gold will be 3. please help.

No comments:

Post a Comment