56,685
社区成员
发帖
与我相关
我的任务
分享
select ID,Name,
(select ActionDate from 表结构和示例 where ID=t.ID and Action=1 order by ActionDate desc limit 1) as ActionDate1,
(select ActionDate from 表结构和示例 where ID=t.ID and Action=2 order by ActionDate desc limit 1) as ActionDate2,
(select ActionDate from 表结构和示例 where ID=t.ID and Action=3 order by ActionDate desc limit 1) as ActionDate3,
(select Operater from 表结构和示例 where ID=t.ID and Action=1 order by ActionDate desc limit 1) as Operater1,
(select Operater from 表结构和示例 where ID=t.ID and Action=2 order by ActionDate desc limit 1) as Operater2,
(select Operater from 表结构和示例 where ID=t.ID and Action=3 order by ActionDate desc limit 1) as Operater3
from 表结构和示例 t
group by ID