码迷,mamicode.com
首页 > 数据库 > 详细

SQL语句

时间:2015-05-21 22:01:48      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

update t_book set book_name=‘newBook‘ where book_count=12

 

select  book_count ,book_id from t_book  where book_name

 

select * from t_book  where book_name

 

select * from t_book 

 

drop table if exists t_class

 

create table if not exists t_class(class_id integer primary key autoincrement,class_name varchar,person_count,integer default 3)

 

select class_id,person_count from t_class where class_id=7 or class_id=8

select class_id,person_count from t_class where class_id=7 and person_count=20

select class_id,person_count from t_class  where  class_id between 7 and 8

select count( 0 )from t_class

//排序

select  * from t_newBook order by newBook_count  desc

//最大小值平均值

select min( person_count )from t_class

select max( person_count )from t_class

select avg( person_count )from t_class

select sum( person_count )from t_class

select abs( person_count )from t_class

//四舍五入

select round( person_count )from t_class

//别名

 select max( person_count) name from t_class

 select replace( class_name,‘a‘,‘o‘)from t_class

//除去空格

select trim( class_name)from t_class

//长度

 select length ( class_name)from t_class

//时间只有日期

 select date () from t_class

//时间是系统时间

 select datetime() from t_class

select * from t_class  where  class_name is null

 

SQL语句

标签:

原文地址:http://www.cnblogs.com/yy515700/p/4520718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!