易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL分页查询

/*第几页必须大于1
select top 每页数量 * id
 from @t a
 where id not in
 (select top (第几页-1)*每页数量 id
  from @t b
 )
*/
declare @lcSqlCommand nvarchar(100)
declare @t table (id int IDENTITY,orderDate datetime)
insert into @t
 select orderDate
  from Northwind..Orders
--返回第二页数据
select top 10 *
 from @t a
 where id not in
 (select top 10 id
  from @t b
 )


相关文档:

[收拢] 用sqlite 执行标准 sql 语法

http://www.umgr.com/blog/PostView.aspx?bpId=36294
 1. 执行sql语句
int sqlite3_exec(sqlite3*, const char *sql, sqlite3_callbacksql 语法
, void *,  char **errmsg );
这就是执行一条 sql 语句的函数。
第1个参数不再说了,是前面open函数得到的指针。说了是关键数据结构。
第2个参数const char ......

读《SQL Server 2005高级管理》的一些摘要... 连载4

SQL Server 2005 数据类型
创建数据库表时,必须为表中的每列分配一种数据类型。
1.       字符串类型
字符串类型包括varchar,char,nvarchar,nchar,text和ntext.这些数据类型用于存储字符数据。Varchar和char类型之间的差别是数据填充。如果要节省空间,为什么有时候还使用char数据类型呢 ......

Oracle或sql2005分页

/// <summary>
        /// 返回分页SQL语句
        /// </summary>
        /// <param name="selectSql">查询SQL语句</param>
        /// ......

oracle sql优化之多表连接优化


Use equality first.
使用等连接
Use range operators only where equality does not apply.
只有在等连接不可用的情况下事由区间连接
Avoid use of negatives in the form of !=
or NOT.
避免使用 != 或者 not
Avoid LIKE pattern matching.
避免使用 LIKE匹配
Try to retrieve specific rows and in small n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号