同一排信息先按时间字段排序,再在上面的排序中按级别字段数排序。这两个字段分别在不同的表中。
求这条语句怎么写?
我是这样写的:
select info_id,dateandtime from info
union all
select flag from company
order by info.info_id desc,company.flag desc
...全文
18712打赏收藏
同一排信息先按时间字段排序,再在上面的排序中按级别字段数排序。这个问题怎么实现?
同一排信息先按时间字段排序,再在上面的排序中按级别字段数排序。这两个字段分别在不同的表中。 求这条语句怎么写? 我是这样写的: select info_id,dateandtime from info union all select flag from company order by info.info_id desc,company.flag desc
select top 10 i_type,i_flag,id,gsid,info_id,showname,dateandtime,Case When info_check=1 Then 1 Else 0 End As flag
from info,company
where info.I_type=0
And Info.GSID=Company.ID
order by dateandtime Desc,gsid Desc
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select top 10 i_type,i_flag,id,gsid,info_id,showname,dateandtime,flag from info,company where info.I_type=0"
if info_check=1 then
sql=sql &" and info.I_flag=1"
end if
sql=sql &" and info.gsid=company.id"
sql=sql & " order by info.info_id desc,company.flag desc"
rs.open sql,conn,1,1