sql 分页语句
1. select top pageSize
* from table where id not in(select top((pageNo-1)*pageSize
) id from table order by id asc)
2. select * from table where id<=pageSize*pageNo
and id>(pageNo-1)*pageSize
order by id asc
注:
pagesize每页显示的记录数
pageNo当前第几页
相关文档:
select * from orders where month(orderdate)= (select month(orderdate) from orders where orderid=10248)
1.一个月第一天的
Select DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
2.本周的星期一
Select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
3.一年的第一天
Select DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
......
# MySQL-Front 5.1 (Build 4.2)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */ ......
Truncate Logs for SQL Server 2008
I had previously posted how to Truncate Logs for SQL Server 2005. Unfortunately, this method does not work in SQL Server 2008. The reason is because the “WITH TRUNCATE_ONLY” command is no longer in SQL 2008. Assuming you run in full recovery mode, the n ......
若要收缩特定数据库的所有数据和日志文件,请执行 DBCC SHRINKDATABASE 命令。若要一次收缩一个特定数据库中的一个数据或日志文件,请执行 DBCC SHRINKFILE
命令。
若要查看数据库中当前的可用(未分配)空间量,请运行 sp_spaceused
。
可在进程中的任一点停止 DBCC SHRINKDATABASE 操作,任何已完成的工作都将保留。 ......
<!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:宋体;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......