我能知道为什么我会错过表达,这句话是否有任何错误。
select *
from
(
select student_id, attendance_day, attendance_id
from attendance
) src
pivot
(
sum(attendance_id)
for attendance_day in ([to_date('23-Oct-2016', 'DD-Mon-YYYY')], [to_date('24-Oct-2016', 'DD-Mon-YYYY')])
) piv;
答案 0 :(得分:1)
更改此行
for attendance_day in ([to_date('23-Oct-2016', 'DD-Mon-YYYY')], [to_date('24-Oct-2016', 'DD-Mon-YYYY')])
到
for attendance_day in (to_date('23-Oct-2016', 'DD-Mon-YYYY'),to_date('24-Oct-2016', 'DD-Mon-YYYY'))