我这里有一张名为TEST
的表格。我想显示我家的左撇子和惯用右手的人数。
怎么会这样做?这是我做的:
+---------+---------+
| NAME | HANDED |
+---------+---------+
| Jeffrey | R |
| Ashley | L |
| Bob | R |
| Dad | R |
| Mom | R |
+---------+---------+
SELECT HANDED, COUNT(HANDED) AS COUNT_HANDED
FROM TEST
WHERE HANDED = 'L' OR HANDED = 'R';
我希望输出如下:
+---------+--------------+
| HANDED | COUNT_HANDED |
+---------+--------------+
| L | 1 |
| R | 4 |
+---------+--------------+
我该怎么办?
答案 0 :(得分:0)
简单!
{{1}}