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

常用sql语句

1.限制返回记录的行数(4-10行)
select rownum,c1 from t144 where rownum<10
minus
select rownum,c1 from t144 where rownum<5
2.批量插入
insert into tablename(select * from othertable)

insert into (column1,column2,,,,,,,)tablename(select column1,column2,,,,,,,from othertable)
3,分组函数(结果中出现的列要在group by 中出现)
select count(age), username, , ,... from table   group by age,usename,,,,...
4.查看数据库中的存在的表
select table_name  from dba_tables (include all users)
select * from tab(include view)
5.高效update,一次修改多个列
update smsmonitor sms
 set (sms.smsmonitor_sendflag, sms.smsmonitor_maxnum) = (select s.smsmonitor_sendflag,
                                                                  s.smsmonitor_maxnum
                                                             from smsmonitor s
                                                            where s.smsmonitor_id =
                      &nbs


相关文档:

SQL创建数据库、表、存储过程及调用

--如果存在数据库programmerPay  就删除
if exists (select * from sysdatabases where name='programmerPay')
drop database programmerPay
go
--创建数据库programmerPay
create database programmerPay
on primary
(
name ='programmerPay_data',
filename='D:\programmerPay\programmerPay_data.mdf',
......

SQL Server里建ORACLE链接服务器的图解

 首先计算机上必须安装oracle,并配置好服务名
  安装oracle的过程中一般会要求建立一个数据库,也可以之后再创建
这个后面有一个 数据库配置助理 (创建修改数据库的,一般密码创建要求字母开头,大于7位啥的)和一个net配置助理(添加或者修改一个数据库服务名),一般用plsql developer远程操作oracle数据库 ......

SQL 收藏 SQL操作全集

SQL操作全集
下列语句部分是Mssql语句,不可以在access中使用。
SQL分类:
DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE)
DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT)
DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)
首先,简要介绍基础语句:
1 ......

SQL Server中CASE的用法


    以前对于Sql Server中Case命令的用法一直不是很了解,今天通过上网查了一些资料,将Case基本的用法总结一下。
Case命令有两种语法: 
A)CASE<运算式>
WHEN <运算式> THEN <运算式>
……
WHEN <运算式> THEN <运算式>
[ELSE<运算式> ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号