![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql基础
qwrrty777
这个作者很懒,什么都没留下…
展开
-
oracle聚合函数忽略空值
select count(*) from utp_stat_testplace u where u.statdate >( select nvl (max(statTime),to_date('2010-01-01 10:20:30','YYYY-MM-DD HH24:MI:SS')) from report_table_maxTime where type=1 grou...原创 2014-05-30 10:34:44 · 2066 阅读 · 0 评论 -
SQL 中UNION 操作符
UNION 操作符用于合并两个或多个 SELECT 语句的结果集。请注意,UNION 内部的 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每条 SELECT 语句中的列的顺序必须相同。 注释:默认地,UNION 操作符选取不同的值。如果允许重复的值,请使用 UNION ALL。 另外,UNION 结果集中的列名总是等于 UNION 中第一个 S...原创 2014-08-27 22:03:11 · 113 阅读 · 0 评论 -
根据入库时间按照30分钟统计数据
select count(*) , ( case float (to_char(createdate,'MI') / 30) when 0 then to_char(createdate,'yyyy-mm-dd HH24' || 00) when 1 then to_char(createdate,'yyyy-mm-dd HH24' || 30) end ) from task gro...原创 2014-09-10 23:09:13 · 334 阅读 · 0 评论