一SQL语句查询两个表的问题
smallSql="Select InfoID,ChannelDir,title From Cl_Article Where instr(SpecialID,'"&AddStrRs("SpecialID")&"')>0 union Select InfoID,ChannelDir,PhotoName as title From Cl_Photo Where instr(SpecialID,'"&AddStrRs("SpecialID")&"')>0 Order By UpdateTime Desc"
想让两个表都按UpdateTime倒序排序,提示"ORDER BY 表达式 (UpdateTime) 包含当前查询未选定的字段。只有第一次查询所包含的字段才可以包含在 ORDER BY 表达式中。"
如果先在union前面的查询语句,不会出错,但举按时间倒序显示。