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

SQL分页查询

thunder:
1.MYSQL实现
mysql> select * from user;
+----+----------+----------+-----------------+
| ID | username | password | email           |
+----+----------+----------+-----------------+
|  1 | admin    | admin    | abc@yahoo.cn    |
|  2 | thomas   | 159753   | thomas@yahoo.cn |
|  3 | thomas1  | 159753   | thomas@yahoo.cn |
|  4 | huhu     | 159753   | hu@yahoo.cn     |
|  5 | fdg      | dfg      | fdg             |
|  6 | sdf      | sd       | sdf@yahoo.cn    |
|  7 | d        | d        | d@d.cn          |
+----+----------+----------+-----------------+
7 rows in set (0.00 sec)
mysql> select * from user limit 3,2;
+----+----------+----------+-------------+
| ID | username | password | email       |
+----+----------+----------+-------------+
|  4 | huhu     | 159753   | hu@yahoo.cn |
|  5 | fdg      | dfg      | fdg         |
+----+----------+----------+-------------+
2 rows in set (0.00 sec)
mysql>
===================================================
2.MSSQLServer实现
select top 5 function_id,function_name from d_function
where function_id not in (select top 5 function_id from d_function)
6 月统计
7 部门查询
8 公司查询
9 工程招标
10 工程总结


相关文档:

使用SQLServer模板来写规范的SQL语句

如果你经常遇到下面的问题,你就要考虑使用SQL Server的模板来写规范的SQL语句了:
SQL初学者。
经常忘记常用的DML或是DDL SQL 语句。
在多人开发维护的SQL中,每个人都有自己的SQL习惯,没有一套统一的规范。
在SQL Server Management Studio中,已经给大家提供了很多常用的现成SQL规范模板。
SQL Server Management ......

SQL SERVER 2005 数据库状态为“可疑”的解决方法

--MyDB为修复的数据名
USE MASTER
GO
SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE
GO
ALTER DATABASE MyDB SET EMERGENCY
GO
sp_dboption 'MyDB', 'single user', 'true'
GO
DBCC CHECKDB('MyDB','REPAIR_ALLOW_DATA_LOSS')
GO
ALTER DATABASE MyDB SET ONLINE
GO
sp_configure 'allow updates ......

SQL Table

Table-Naming Standards
Table-naming standards, as well as any standard within a business, are critical to
maintaining control. After studying the tables and data in the previous sections, you
probably noticed that each table’s suffix is _TBL. This is a naming standard selected
for use, suc ......

SQL Server 2005中的文件和文件组

1、文件和文件组的含义与关系
    每个数据库有一个主数据文件.和若干个从文件。文件是数据库的物理体现。 文件组可以包括分布在多个逻辑分区的文件,实现负载平衡。文件组允许对文件进行分组,以便于管理和数据的分配/放置。例如,可以分别在三个硬盘驱动器上创建三个文件(Data1.ndf、Data2.ndf&nb ......

在SQL Server启动时自动执行存储过程

问题
  当sql server启动时,我很想运行一个存储过程。有没有一种方法可以在每次SQL Server服务启动时都会自动执行这个存储过程呢?
  专家解答
  sql Server提供了系统存储过程sp_procoption,这个存储过程可以用于当SQL Server服务启动时指派一个或者多个存储过程自动执行。这是一个很不错的选择,它可以用于多种 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号