I have 2 simple table:
Table a:
+====+======+
| ID | Name |
+====+======+
| 1 | Alex |
| 2 | Steve|
+===========+
Table b:
+======+======+
| ID_B |Number|
+======+======+
| 1-20 | 20 |
| 1-21 | 40 |
+=============+
I tied to use this syntax:
SELECT `Name`,sum(`Number`) From `a` Join `b` ON `a`.`ID` LIKE `b`.`ID_B`+'%'
I don't know all about Mysql, am a newbie. I want to join table a to table b, and in table b Number's is automatically count all WHERE ID table a is Same like b .ID_B %
Finally my answer is "Alex have 60 Number".