一个表是放产品信息,info_id 是产品信息的ID。另一个表是放公司的信息,flag是公司的级别,有普通会员,高级会员。
我是先按产品信息发布时间排序,在这个排序上再按公司级别排序。

解决方案 »

  1.   

    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
      

  2.   

    这是整个代码,关联字段应该是info.gsid=company.id
      

  3.   

    select top 10 i_type,i_flag,id,gsid,info_id,showname,dateandtime,flag 
    from info,company 
    where info.I_type=0
    order by dateandtime,gsid
      

  4.   


    dateandtime ,gsid有先后之分吗
      

  5.   

    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