---
title: "最近访问5人"
author: "aviva"
date: "2008-12-23T09:32:00Z"
tags: []
slug: "5"
draft: false
lastmod: "2008-12-23T09:32:00Z"
id: 360746
url: "https://aviva.iteye.com/blog/360746"
---

//我的所有日志id  
select mjrzid from dede\_mjrz\_employee where modifydate is not null and employeeid ='575'

//找到所有查看过我的日志的员工id,姓名，阅读日期 ，包括自己了  
select employeeid,name,readdate  from dede\_mjrz\_employee  
left join dede\_employee on employeeid = id  
 where mjrzid in(  
select mjrzid from dede\_mjrz\_employee where modifydate is not null and employeeid ='575'  
)

//只保留读我日志的人员名字  
select name from dede\_mjrz\_employee  
left join dede\_employee on employeeid = id  
 where mjrzid in(  
select mjrzid from dede\_mjrz\_employee where modifydate is not null and employeeid ='575'  
) and readdate in(  
    select max(readdate) from dede\_mjrz\_employee where readdate is not null group by employeeid  
    )  
order by readdate desc