Oracle温习与入门
SQL Server开发者Oracle快速入门 http://kb.cnblogs.com/a/853694 简单概念的介绍 1. 连接数据库
S: use mydatabase
O: connect username/password@DBAlias
conn username/password@DBAlias 2. 在Oracle中使用Dual, Dual是Oracle一个特有的虚拟表, Oracle中很多系统的变量和函数都可以通过Dual中获得
S: select getdate();
O: select sysdate from dual; 3. Select Into和Insert 语句的使用, 在SQL Server中的Select Into语句在Oracle中一般是Insert into…select…, 另外2个数据库都支持标准的SQL, 写法上略有区别
S: select getdate() mycolumn into mytable;
Insert mytable values(‘more text’);
O: insert into mytable select getdate() mycolumn from dual
insert into mytable (mycolumn) values(sysdate); 4. Update语句
S: update mytable set mycolumn=myothertable.mycolumn
from mytable,myothertable
where mytable.mycolumn like 'MY%' and myothertable.myothercolumn='some text';
O: update mytable set mycolumn=
(select a.mycolumn from myothertable a
where myothertable.myothercolumn='some text')
where mytable.mycolumn like 'MY%'; 5. Delete语句
S: delete mytable where mycolumn like 'some%';
O: delete from mytable where mycolumn like 'some%'; 6. 使用开发管理的软件
S: isql
osql: for queries developed in SQL Analyzer
SQL Server Management Studio Express 图形化管理工具
O: sqlplus
PL/SQL Developer 图形化开发管理工具
TOAD 图形化开发管理工具
注: 个人建议基本的简单的Select
相关文档:
--如何用grade表的资料去更新usertable表的资料(有关联的字段userid)
update usertable u set u.grade =
(select g.grade from grade g where g.userid = u.userid);
--如何使查询结果字段生成序号
select rownum, t.* from sm_t_pad_new t
--如何快速做一个和原表一样的备份表
create ......
The DB File Sequential Read wait event generally indicates a single block read (an index read,
for example). A large number could indicate poor joining orders of tables or unselective indexing.
This number will certainly be large (normally) for a high-transaction, well-tuned system. You ......
今天参加了Oracle & SUN合并后第一次与合作伙伴及客户的通气会。整个会议给我的感觉是:Oracle雄心勃勃,SUN意气风发,而我自己,心怀惴惴。 Oracle有了SUN,那么从硬件到软件Oracle的产品线就十分齐备了。Oracle半年前推出11gR2 for linux,接着for solar ......
因为很少用到, 所以几乎忘记了这几个函数, 不过它们还是很有用的使用它们可以大大简化一些SQL文的语法, 至于效率问题, 如CCW所说它们和EXISTS, IN 之类没有什么差别, 而且要具体问题具体分析
其中ANY和SOME在意思上是相同的, 可以相互替代.
举几个例子来说明ALL和ANY的用法
1. SELECT * from TABLEA WHERE FLD > AL ......
Wait Problem Potential Fix Sequential Read Indicates many index reads—tune the code (especially joins) Scattered Read Indicates many full table scans—tune the code; cache small tables ......