MySQL 创建视图增加一列类似ID的标识列
CREATE
VIEW `rs_zb_choicestaff_view` AS
SELECT
`a`.`AttendTime` AS `AttendTime`,
`a`.`StaffId` AS `StaffId`,
count(0) AS `ATTENDID`
FROM
(
`rs_zb_attendstaff` `a`
JOIN `rs_zb_attendstaff` `b`
)
WHERE
(
(
`a`.`AttendStaffid` >= `b`.`AttendStaffid`
)
AND (`a`.`AUDITSTATUS` = 1)
)
GROUP BY
`a`.`AttendTime`,
`a`.`StaffId`
ORDER BY
`ATTENDID` ;
为什么ATTENDID这个列会存在重复值