Page 1 of 1

Error in Query

Posted: Sun Sep 23, 2007 5:23 am
by antony_xavier
I am getting one error in the following query when using in Forms.The error is "Encounted Symbol "("When expecting one of the Following: ,from ).
But the same query is working in Sql Plus.Please Help

Thanks
Ax

Query
--------
select att_empcode,
max(decode(column#,1,att_time)),
max(decode(column#,2,att_time)),
max(decode(column#,3,att_time)),
max(decode(column#,4,att_time))
into :ATT_EMPCODE,:Att_Time,:Outime1,:Intime2,:Outtime2
from (select att_empcode,att_time,row_number()
over (partition by att_empcode order by att_time) as column#
from xxatn_final_att
where att_date = '12/09/07')
group by att_empcode order by 1

Posted: Sun Sep 23, 2007 11:56 pm
by ahmadbilal
please change this alias name from column# to columnno

over (partition by att_empcode order by att_time) as <u><b>column#</b></u>