在oracle中缺少表达式

时间:2016-03-04 04:53:49

标签: sql oracle11g

我能知道为什么我会错过表达,这句话是否有任何错误。

    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;

1 个答案:

答案 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'))