asp sql两张相同表查询数据排序

来源:互联网 发布:在奥地利生活 知乎 编辑:程序博客网 时间:2024/05/07 02:21

tb1  name score

tb2  name score

 

数据

李四 22

张三 11

王五 33

麻子 44

 

 

 

<!--#include file="conn.asp"--><% Set RS=conn.Execute("select * from tb1 union select * from tb2 order by score")do while not RS.eof  %> id:<% =RS(1) %><p> name:<% =RS(2) %><p> score:<% =RS(3) %><p>  <hr><%RS.movenext loop RS.Close conn.CloseSet RS = NothingSet conn = Nothing%>


 

 

查询出

 

张三 11

李四 22

王五 33

麻子 44

 

 

原创粉丝点击