create or replace view v_action(id , type , time)
as
select id , 3 , ptime as time from photo
union all
select id , 4 , ctime as time from comment
union all
select id , type , atime as time from action
转载于:https://my.oschina.net/thinkinginc/blog/59692