Frequence statement of SQL
来源:互联网 发布:淘宝收件人姓名怎么改 编辑:程序博客网 时间:2024/06/05 02:32
select * from perinfo where workyear between 0.3 and 0.6
select * from perinfo where address like '%桥头%'
select * from hi4 where score between 90 and 100
select * from hi2 where order by score asc
delete from perinfo where perid=0802028
drop table hi1 --删除表
use stcard_enp
--查看后十个
SELECT top 10 * FROM KQ_DOWNLOAD WHERE PERSON_ID=305004 order by id_key desc
alter table hi2 add BornIK varchar(30),BornIR varchar(30) --增加列
alter table hi2 alter column bornik varchar(40) --修改列的数据类型
ALTER TABLE hi2 DROP COLUMN BornIE --删除列
DELETE FROM person WHERE perid=0802028 --删除行
create table hi4 (name char(5),age char(5) ) --创建表和列
waitfor delay '00:00:05' ---延时一段时间再执行
waitfor time '23:08:00' --等到晚上23点再执行
select * from perinfo where PerID=0802028
insert into hi2(name,score) values('green',89) --增加行
update hi2 set name='hill',score=78 where name='green' --更新单元格数据
delete from hi2 where age=11 --删除行
truncate table hi2 --清除所有行,人保持表的完整性
sp_help table_name --显示表的特性
insert into hi2(score,inte) values(max(select age from hi2),'play') --复合运算
create index index_name on table_name (colum_name) --增加索引
select * from table_name order by colum_name desc --按照从大到小的顺序排列 不要desc就是小到大
select COUNT(*) from table_name where colum_name='pi' --查询符合该列名的个数
select sum(colum_name) from table_name --查询改列的和 其他的函数还有 MAX() MIN() AVG()
select top 20 percent * from hi2 --返回结果的百分之二十
select name as haha from hi2 where score<70 --between 80 and 90
select * from hi2 where score=(select max(score) from hi2) --取出SCORE最大的数的那一列
create table table_name (name char(20), age smallint, lname varchar(30)) --增加表和列
select sum(age),name from hi2 group by name --把NAME列名字相同的加起来一块显示
use ktv
select replicate('123',3) --返回3个连续的123 123123123
select col_length('hi2','age') --返回AGE列数据类型定义的大小
select * from hi2 where score <> 90 --<>不等于 !>不大于 not between
select column_name1 as column_name2 from hi2 把column_name1中的用column_name2的名字表示
select * from hi3 where name in('bike', 'ki') --在name列中查找bike和ki两项
select table_name1.column1,table_name2.column2 from table_name1 ,table_name2 --从两个列表中取出两列来
select * from hi3 where name='mike' and score=84 --查找姓名为make分数为84的行
UPDATE Person SET FirstName = 'Fred' WHERE LastName = 'Wilson'
select * into hi3 from hi2 --把表二备份到一个新的表中
select name from hi3 union select love from hi2 --联合查询
update hi3 set age=score --复制列
GO --表明下面为SQL语句块
sp_help kq_download --查看表的属性
,brush_datetime,,'2009-09-21 11:35:00'
select getdate()
select * into b from a --建立一个中间表
select Convert(char(10),GetDate(),108)
insert into kq_download(person_id,card_no,Brush_Date,Brush_Time,moc_no,Data_Flag) values(999999,999999,GetDate(),GetDate(),'01',10)
- Frequence statement of SQL
- some useful select statement of SQL
- What are "versions" of an SQL statement?
- Definition of SQL statement execution(parse/execute/fetch)
- sql statement
- PNP : Work Cound & Frequence
- SQL Error:An aggregate may not appear in the set list of an UPDATE statement.
- Oracle RDBMS : Flushing a Single SQL Statement out of the Object Library Cache
- 053-16 Which statement most accurately describes the implementation of a SQL Access Advisor recommen
- 16 Which statement most accurately describes the implementation of a SQL Access Advisor recommendati
- 97.Which statement is true about loading data using the conventional path of SQL*Loader?
- DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;,?,?,?,?,?,?,?,?);END-OF-STATEMENT
- SQL case statement
- SQL Statement Tuning
- Oracle sql statement tuning
- Statement、PreparedStatement执行SQL
- sql之statement
- Sql Statement Turing part1
- 填报表中自动计算单元格显示格式的设置
- 从远景论坛上学到的完美激活NERO8 NERO9的经验
- ARM存储器映射、重映射与启动
- POJ 2036 I Conduit!
- Linux系统文件目录简介
- Frequence statement of SQL
- 将Flex集成到Java EE应用程序的最佳实践
- linux基础知识
- SNTP 协议翻译介绍
- 在google上开发自己的java应用
- 即时报表中的统计图数据量控制
- Java 5.0 泛型之 普通泛型
- 求职自我批评!
- ???