最近常用的sql语句
来源:互联网 发布:图书馆软件知乎 编辑:程序博客网 时间:2024/05/16 14:14
use cms
go
---进入cms数据库--
--查询数据库里状态为已签发和插入时间为当前时间前24小时以内的文章--
select * from cms_article where status='4' and DateDiff(hh,insertedTime,getDate())<=24
--返回查询条数,查询指定时间以前的文章--
select count (*) as rownum from cms_article where status='4' and insertedTime<'2009-12-24'
---更新时间为系统当前时间,指定的文章把时间更新--
go
---进入cms数据库--
--查询数据库里状态为已签发和插入时间为当前时间前24小时以内的文章--
select * from cms_article where status='4' and DateDiff(hh,insertedTime,getDate())<=24
--返回查询条数,查询指定时间以前的文章--
select count (*) as rownum from cms_article where status='4' and insertedTime<'2009-12-24'
---更新时间为系统当前时间,指定的文章把时间更新--
update cms_article set insertedTime =getDate() where insertedTime< '2009-12-24'
--双表查询,查询结果插入到另一张表中--
insert into cms_addURLContentSeo(id,keywords,url,insertedTime) select a.id as id,a.[name] as keywords,b.website as url,a.insertedtime as insertedTime from cms_category as a join cms_corp as b on a.id=b.id
--删除url为空的--
delete from cms_addURLContentSeo where url=''
0 0
- 最近常用的sql语句
- 最近常用的linux语句
- 最近用的SQL语句
- 常用的SQL语句
- 常用的SQL语句
- 常用的SQL语句
- 常用的SQL语句
- 常用的SQL语句
- SQL语句常用的
- 常用的sql语句
- 常用的SQL语句
- 常用的SQL语句
- SQL的常用语句
- 常用的SQL语句..
- 常用的sql语句
- sql 常用的语句
- sql的常用语句
- sql常用的语句
- Linux Shell编程case语句
- Alice and Bob
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- mtk系统定制注意事项—
- MOno C# 开发自动更新的时候出现签名冲突 的问题
- 最近常用的sql语句
- 一种整数数据压缩存储的算法实现
- cocos2d-x 移植到android中编译的一些问题:fatal error: Box2D/Box2D.h: No such file or directory"
- C++/C课程设计(1)课题要求文档
- .net的验证码
- magento 中 直接写sql语句
- vc 2005运行时的问题导致在客户机上不能运行
- Happy Number
- 关于JavaScript中toSource问题的小结