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
这是整个代码,关联字段应该是info.gsid=company.id
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
好 dateandtime ,gsid有先后之分吗
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
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
from info,company
where info.I_type=0
order by dateandtime,gsid
dateandtime ,gsid有先后之分吗
from info,company
where info.I_type=0
And Info.GSID=Company.ID
order by dateandtime Desc,gsid Desc