这是我的表格呼叫TrainingPresence
+-------+-----------+-----------+-----------+
| Name | FootNov12 | HandNov15 | FootNov22 |
+-------+-----------+-----------+-----------+
| Clem | x | Abs | Abs |
+-------+-----------+-----------+-----------+
| Kevin | x | x | x |
+-------+-----------+-----------+-----------+
我想选择球员参加足部训练的名称和时间。
FootNov12 = Football Novembrre 12th
FootNov22 = Football November 22th
HandNov15 = Handball November 15th
select查询应该给我:
Name | Count
Clem | 1
Kevin| 2
但是我不知道该怎么做 感谢您的帮助。
答案 0 :(得分:1)
标准化的架构可能看起来像这样
users
user_id name
1 Clem
2 Kevin
training
user_id date sport
1 2018-11-15 Handball
1 2018-11-11 Football