CREATE ALGORITHM=UNDEFINED DEFINER=`sa`@`%` SQL SECURITY DEFINER VIEW `opitem_group_vn_sum` AS (select `opitemrece`.`hn` AS `hn`,`opitemrece`.`vn` AS `vn`,`opitemrece`.`rxdate` AS `rxdate`,`opitemrece`.`rxtime` AS `rxtime`,`kskdepartment`.`department` AS `department`,sum(`opitemrece`.`sum_price`) AS `sumall`,`doctor`.`name` AS `doctorname` from ((`opitemrece` join `doctor` on((`opitemrece`.`doctor` = `doctor`.`code`))) join `kskdepartment` on((`opitemrece`.`dep_code` = `kskdepartment`.`depcode`))) group by `opitemrece`.`vn`)