H
hehuan
Unregistered / Unconfirmed
GUEST, unregistred user!
SELECT cls_cours, SUM(ins_tarif+ins_frais) as TarifTotal FROM Inscription ins, Classe cls WHERE ins_classe=cls_id GROUP BY cls_cours
+-----------+------------+
| cls_cours | PriceTotal |
+-----------+------------+
| English | 180 |
| ATT | 17529 |
| BAC | 1000 |
| BTS | 500 |
| Chinese | 6966 |
| E.E. | 14880 |
| French | 200 |
| PREPA | 21400 |
+-----------+------------+
请问我如何可以用SQL直接把English和French的值合并为一个值, BTS与BAC值合并?非常感谢!期望结果如下:
+-----------+------------+
| Foreign | 380 |
| ATT | 17529 |
| BTS_BAC | 1500 |
| Chinese | 6966 |
| E.E. | 14880 |
| PREPA | 21400 |
+-----------+------------+
+-----------+------------+
| cls_cours | PriceTotal |
+-----------+------------+
| English | 180 |
| ATT | 17529 |
| BAC | 1000 |
| BTS | 500 |
| Chinese | 6966 |
| E.E. | 14880 |
| French | 200 |
| PREPA | 21400 |
+-----------+------------+
请问我如何可以用SQL直接把English和French的值合并为一个值, BTS与BAC值合并?非常感谢!期望结果如下:
+-----------+------------+
| Foreign | 380 |
| ATT | 17529 |
| BTS_BAC | 1500 |
| Chinese | 6966 |
| E.E. | 14880 |
| PREPA | 21400 |
+-----------+------------+