当前位置:Gxlcms > mysql > mssqlsql分页语句

mssqlsql分页语句

时间:2021-07-01 10:21:17 帮助过:72人阅读

mssql sql 语句

sql="select top 1 ddd from id,title,time,sum(id) as vv,a.id,b.id where table1,table2astb2 order by a.title like '%"&title&"%' desc"
rs.open sql,conn,1,1
if rs.eof then
else
ddd = rs("ddd")
end if
rs.close

类型: 查询单条记录 查询多条记录 分页 查询全部记录

字段名: 觉得麻烦
多个字段名用英文逗号隔开
如:id,title,time,sum(id) as 别名,a.id,b.id

表名:
多个表名用英文逗号隔开
如:table1,table2 as tb2
条件:
支持and,or,注意一下字段的类型,最后的条件字段需要注意
数字型title='"&title&"' and id="&id&"
字符型id="&id&" and title='"&title&"'
多表查询:a.title='"&title&"'
或者:a.title like '%"&title&"%'
顺序: 降序 升序
表单中不填,后面的顺序不起作用
多个顺序,用英文逗号隔开,前面的字段请自己加desc或asc,最后一个
不需要加

人气教程排行