数据库
文章平均质量分 64
lixiaoming000
这个作者很懒,什么都没留下…
展开
-
一些数据库优化方面的经验
用PreparedStatement 一般来说比Statement性能高:一个sql 发给服务器去执行,涉及步骤:语法检查、语义分析, 编译,缓存“inert into user values(1,1,1)”-à二进制“inert into user values(2,2,2)”-à二进制“inert into user values(?,?,?)”-à二进制 有外原创 2013-10-29 15:29:45 · 1944 阅读 · 0 评论 -
union和union all有什么不同?
假设我们有一个表Student,包括以下字段与数据:drop table student;create table student(id int primary key,name nvarchar2(50) not null,score number not null);insert into student values(1,'Aaron',78);inser原创 2013-10-29 15:32:30 · 420 阅读 · 0 评论 -
存储过程与触发器
create procedure insert_Student (_name varchar(50),_age int ,out _id int)begininsert into student value(null,_name,_age);select max(stuId) into _id from student;end; call insert_Student('w原创 2013-10-29 15:28:37 · 630 阅读 · 0 评论 -
分页语句
取出sql表中第31到40的记录(以自动增长ID为主键)sql server方案1:select top 10 * from t where id not in (select top 30 id from t order by id ) orde by idsql server方案2:select top 10 * from t where id in (select top 4原创 2013-10-29 15:32:03 · 506 阅读 · 0 评论 -
数据库建表原则
数据库建表原则关键字: 数据库建表原则 ·1. 原始单据与实体之间的关系 可以是一对一、一对多、多对多的关系。在一般情况下,它们是一对一的关系:即一张原始单据对应且只对应一个实体。在特殊情况下,它们可能是一对多或多对一的关系,即一张原始单证对应多个实体,或多张原始单证对应一个实体。这里的实体可以理解为基本表。明确这种对应关系后,对我们设计录入界面大有好处。转载 2014-03-09 19:06:40 · 1216 阅读 · 0 评论 -
数据库查询语句,oracle查询一个表中字段相同信息的个数并按个数排序
表名:hotsearch 字段:hotword select distinct hotword, count(hotword) from hotsearch group by hotword order by count(hotword) desc;原创 2014-03-28 10:56:20 · 1621 阅读 · 0 评论