【发布时间】:2021-09-27 14:01:13
【问题描述】:
我有一张如下所示的表格:
+--------------+----------------+
| PersonColumn | AttendedColumn |
+ ------------ + -------------- +
| person1 | attended |
| person1 | not attended |
| person2 | not attended |
| person2 | not attended |
| person2 | not attended |
| person3 | attended |
| person3 | attended |
+--------------+----------------+
所以我想要一个 select 语句来输出这个:
+---------+-----+
| person1 | 1 |
| person2 | 0 |
| person3 | 1 |
+---------+-----+
也就是说,如果该人至少参加过一次,则输出 1。否则输出零。我正在使用 ORACLE
【问题讨论】: