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

SQL语句PART1

Oracle SQL(partI)
Data manipulation language(DML): select, insert, update, delete, merge.
Data definition language(DDL): create, alter, drop, rename, truncate, comment
Data control language(DCL): grant, revoke
Transaction control: commit, rollback, savepoint
Arithmetic Expressions:
+, -, *, /
1) Arithmetic expressions containing a null value evaluate to null 
Column Alias
1) requires double quotation marks if it contains spaces or special characters, or if it is case-sensitive
e.g.: select last_name as name, commission_pct comm from employees;
e.g.: select last_name  "Name", salary*12 "Annual Salary" from employees 
Alternative Quote(q) Operator
e.g.: select depart_name||' Department'||q'['s Manager is ]'||manager_id as "Department and Manager"
results:
Department and Manager
Administrator Department's Manager is Me
...
Using DESCRIBE to display the table structure
e.g.: describe tb1;
Rules of precedence for operators in an expression
1   Arithmetic operators
2  Concatenation operator
3  Comparison conditions
4  IS [NOT] NULL, LIKE, [NOT] IN
5  [NOT] BETWEEN
6  Not equal to
7  NOT logical condition
8  AND logical condition
9  OR logical condition
e.g.: select last_name, job_id, salary from employees where job_id='SA_REP' or job_id='AD_PRES' and salary>15000;
means: select job_id='SA_REP' or (job_id='AD_PRES' and salary>15000)
e.g.: select last_name, job_id, salary from employees where (job_id='SA_REP' or job_id='AD_PRES') and salary>15000
Sorting:
can be sorted by column's numeric position
eg.: select last_name, job_id, department_id, hire_date from employees order by 3; 
Substitution Variables
1. temporarily store values with & and &&
2. using in following conditions: where conditions, order by clauses, column expressions, table names, entire select statements.
e.g.: select employee_id, last_name, salary, department_id from employees where e


相关文档:

如何卸载SQL Server 2005

卸载SQL Server 2005的方法之一,放在这儿只是为了记住:
1:把SQL Server2005的安装盘(安装文件)放入到光驱。
2:打开如下路径:开始/运行,输入:cmd
3:输入下列命令:
 
Start /wait \setup.exe /qb REMOVE=ALL INSTANCENAME=:管区盘符,例如:G:、H:等;:安装的SQLServer实例名称,默认值为:功能 ......

sql函数常用函数

1.     select replace(CA_SPELL,' ','') from hy_city_area  去除列中的所有空格
2.     LTRIM() 函数把字符串头部的空格去掉
3.     RTRIM() 函数把字符串尾部的空格去掉
4.     select LOWER(replace(CA_SPELL,' ','')) f ......

关于SQLSERVER中更新Text类型SQL语句解析

 基本方法:
                   
UPDATETEXT { table_name.dest_column_name dest_text_ptr }//{ 要更新的表以及 text、ntext 或 image 列的名称,指向要更新的 text、ntext 或 image 数据的文本指针的值(由 TEXT ......

06—PL/SQL编程

PL/SQL: Oracle中的SQL过程化编程语言
1. PL/SQL程序是由块结构构成,格式如下:
  [DECLARE
   --声明部分
 ]
  BEGIN
   -- 主体
   [EXCEPTION
     -- 异常处理块
   ]
  END;
  /  --块的结束
2.变量
简单变量: ......

ORACLE和POSTGRESQL的SQL语句比较

oracle 方法                                                & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号