我现在有四张表,表结构不同,都是时间列,需要根据时间排序四张表的信息然后展示出来,那位大神给个思路,demo什么的。
第二个问题。。
(select plId as ID,plUserId as UserId,plTime as Times,'publish' as 'Staus' from publish ) as t1,
(select id as ID,userId as UserId,logTime as Times,'log' as 'Staus' from [log]) as t2
可不可以让t1 与t2的 列合并起来 然后根据时间排序
求指点
能有个例子是最好的
select plId as ID,plUserId as UserId,plTime as Times,'publish' as 'Staus' from publish ) as t1
UNION ALL
select id as ID,userId as UserId,logTime as Times,'log' as 'Staus' from [log]) as t2
这样就可以了啊。
大叔正解。
需要每个表都展示所有列的数据吗?
对于t1与t2合并,大叔的回答就ok了~
使用视图。