首页 > 数据库技术 > 详细

SQL语句

时间:2015-05-21 22:00:38      阅读:334      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!