ERROR IN parameter passing in pivot table mysql -
updated:
i using pivot table displaying column names header per knowledge fine when tried add together parameter getting error while
calling
call sp_schreport(1,2,'2014-10-04'); $$
and when tried add together
"select venue,'null' first,'null' second,'null' third,'null' 4th sch_venue campusid =campid , venueid not in (select venueid sch_taskassigned assignedstatus=status , (sdate between taskstartdate , taskenddate)) union"
along code getting error union function both query column should equal have used 'null' first etc..
create procedure sp_schreport(in campid int,in status int,in sdate datetime) begin set @sql = null; select group_concat(distinct concat( 'max(case when t.session = ''', t.session, ''' d.department end) `', tagname, '`' ) ) @sql sch_sessions t; set @sql = concat('select venue,'null' first,'null' second,'null' third,'null' 4th sch_venue campusid =campid , venueid not in (select venueid sch_taskassigned assignedstatus=status , (sdate between taskstartdate , taskenddate)) union select v.venueid, ', @sql, ' sch_taskassigned p left bring together sch_sessions t on p.sid = t.sid inner bring together sch_venue v on p.venueid=v.venueid inner bring together sch_departments d p.campusid=campid , p.assignedstatus=status , (sdate between taskstartdate , taskenddate) grouping p.venueid'); prepare stmt @sql; execute stmt; deallocate prepare stmt; end$$
kindly find out mistakes in procedure
mysql
No comments:
Post a Comment