网盘文件被下载过的记录查询脚本(亲测有效)

SELECT l.CN_S_OPERATOR_ID AS 登录名, l.CN_S_OPERATOR AS 用户名, l.CN_T_OPERATING AS 下载时间, d.CN_S_NAME AS 文件名, d.CN_S_VERSION AS 版本
FROM (
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_0
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_1
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_2
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_3
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_4
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_5
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_6
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_7
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_8
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'

UNION ALL
SELECT CN_S_DOC_ID, CN_S_OPERATOR_ID, CN_S_OPERATOR, CN_T_OPERATING
FROM OI_DMS_DOC_LOG_9
WHERE CN_T_OPERATING >= '2010-1-1'
AND CN_S_OPERATE_TYPE = '下载'
) l

INNER JOIN OI_DMS_DOC d ON d.CN_S_ID = l.CN_S_DOC_ID
ORDER BY d.CN_S_NAME

posted @ 2021-06-11 10:02  mobox  阅读(299)  评论(0编辑  收藏  举报