rs.Source= "SELECt * FROM crsh,itsm,qgzx,xxdd,xywh,yl order by dianji ASC"
我的是这样,那有错?该怎么写
不是各个表里独自的排序我要的是集合这几个表的内容然后在排序
原来那个不是
效果和原来你给我的一样
我想做个函数把各个表里的文章根据点机的多少来排序
asp中如何从多个表中查询数据(字段都一样)然后根据一个字段排序
答案:5 悬赏:70 手机版
解决时间 2021-12-20 01:04
- 提问者网友:火车头
- 2021-12-19 07:46
最佳答案
- 五星知识达人网友:青灯有味
- 2022-01-05 16:38
那就试试这个
SELECt * FROM (
SELECt * FROM crsh
UNIOn
SELECt * FROM itsm
UNIOn
SELECt * FROM qgzx
UNIOn
SELECt * FROM xxdd
UNIOn
SELECt * FROM xywh
UNIOn
SELECt * FROM yl)
ORDER BY dianji ASC
SELECt * FROM (
SELECt * FROM crsh
UNIOn
SELECt * FROM itsm
UNIOn
SELECt * FROM qgzx
UNIOn
SELECt * FROM xxdd
UNIOn
SELECt * FROM xywh
UNIOn
SELECt * FROM yl)
ORDER BY dianji ASC
全部回答
- 1楼网友:猎心人
- 2022-01-05 20:01
function hot(N,len1)
dim i, cha
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = conn
rs.Source= "SELECt * FROM ( SELECt * FROM crsh UNIOn SELECt * FROM itsm UNIOn SELECt * FROM qgzx UNIOn SELECt * FROM xxdd
UNIOn SELECt * FROM xywh UNIOn SELECt * FROM yl) ORDER BY dianji ASC "
rs.Open ,,1,1
i=0
response.write("")
rs.Movefirst
do while not rs.eof and icha=rs("biaoti")
if len1 cha=left(rs("biaoti"),len1)
response.write("
("class1")&" >"&cha&"......
") else response.write(" ("class1")&" >"&cha&"
") end if rs.Movenext i=i+1 loop response.write(" ")
i=0
response.write("")
rs.Movefirst
do while not rs.eof and i
response.write(""&rs("time")
&"
") rs.Movenext i=i+1 loop response.write(" ")
rs.close
set rs=nothing
end function
这个是我的程序
而且第2个循环没用了 恐怕是rs.movefirst的问题
走过路过的各位大哥大婶帮帮小弟吧~~~~TT
") else response.write(" ("class1")&" >"&cha&"
") end if rs.Movenext i=i+1 loop response.write("
") rs.Movenext i=i+1 loop response.write("
- 2楼网友:渡鹤影
- 2022-01-05 18:35
select * from table order by from_, to_
asc降序,desc升序
- 3楼网友:白昼之月
- 2022-01-05 17:09
select crsh.a
from
crsh,
itsm,
qgzx,
xxdd,
xywh,
yl
and
crsh.a=itsm.b
itsm.b=qgzx.c
qgzx.c=xxdd.d
xxdd.d=xywh.e
xywh.e=yl.f
order by
dianji ASC
a-f 都是表示相同的字段,只是在不同表中的。
这个是关联查询,你可以查下着方面的资料.
还有外联,内联之说,我忘记的差不多了,也不晓得对不对.
- 4楼网友:拜訪者
- 2022-01-05 16:48
SELECt * FROM (
SELECt * FROM crsh
UNIOn
SELECt * FROM itsm
UNIOn
SELECt * FROM qgzx
UNIOn
SELECt * FROM xxdd
UNIOn
SELECt * FROM xywh
UNIOn
SELECt * FROM yl)
ORDER BY dianji ASC
是对的就是有一个问题需要根据需求改动
union 是会过滤掉重复记录的
union all 不会过滤重复记录
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯