Home >Database >Mysql Tutorial >access sql语句问题

access sql语句问题

WBOY
WBOYOriginal
2016-06-07 15:30:581431browse

在mysql数据库里sql 语句 有limit的用法,而在access里没有,如要在access里使用例如limit的功能,可以使用如下: select * from TABLE limit starRow,pageSize (表是id 升序排列的) select * from ( select toppageSize * from ( select top(startRow + pag

在mysql数据库里sql语句有limit的用法,而在access里没有,如要在access里使用例如limit的功能,可以使用如下:
select * from TABLE limit starRow,pageSize
(表是id 升序排列的)
select * from (
   select top pageSize * from ( 
      select top (startRow + pageSize -1)  * from TABLE
   )
   order by id desc
)
order by id asc
 
(表是id降序排列的)
select * from(
 select top pageSize *  from (
  select top (startRow + pageSize -1) * from TABLE 
  ) 
  order by id asc
)
order by id desc
 
在sql里还有可以使用create newtable like oldtable 此种语句,在access就不行了,可以实现同种效果的语句
select * into NEWTABLE from  OLDTABLE
 
 
参考地址:
http://www.xffox.com/blog/archives/48
http://www.pcbookcn.com/article/1179.htm
http://www.cnblogs.com/evernory/archive/2006/12/07/585374.html
Statement:
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