计算行的总值

时间:2017-02-15 04:12:53

标签: mysql sql count

我有一个如下所示的SQL表:

if player_card == 'Jack' or player_card == 'jack':
    player_card = 11

elif player_card == 'Queen' or player_card == 'queen':
    player_card = 12

elif player_card == 'King' or player_card == 'king':
    player_card = 13

elif player_card == 'Ace' or player_card == 'ace':
    player_card = 14
else:
    player_card = int(player_card)

我想计算每行的id | value ----------------------- 1 | 5 2 | 5 3 | 6 。 在此示例中,输出应为value

我应该使用什么查询来计算行的总值?

1 个答案:

答案 0 :(得分:0)

您可以在那里了解有关COUNT()函数的更多信息。

https://www.w3schools.com/sql/sql_func_count.asp