Home > Database > Mysql Tutorial > mssql sql 分页语句

mssql sql 分页语句

WBOY
Release: 2016-06-07 17:47:44
Original
976 people have browsed it

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,最后一个
不需要加

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template