oracle的sql积累..&..decode函数使用
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle的sql积累..&..decode函数使用,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2449字,纯文字阅读大概需要4分钟。
内容图文
![oracle的sql积累..&..decode函数使用](/upload/InfoBanner/zyjiaocheng/466/60b1ff44a4d4414aa6412f20502486c0.jpg)
SELECT a.areaname as 二级地名 FROM houses h,houses h2,
areas a WHERE h.areaid=a.areasid AND h2.areaid=a.areasid AND h.finalassessmentid=1 AND
h.houseslevel=2 AND h2.houseslevel=1 AND a.areasid!=a.parentareasid AND a.companysid=2;
select * from areas
select count(h.houseslevel) as 总数,count(h1.houseslevel) as 最新累计成盘,count(h2.houseslevel) as 最新累计必交盘 from houses h,houses h1,houses h2 where h.houseslevel in (1,2) and h1.houseslevel=1 and h2.houseslevel=2;
select count(h.houseslevel) as 总数 from houses h where h.houseslevel in (1,2)
union all
select count(h.houseslevel) as 成盘 from houses h where h.houseslevel=1
union all
select count(h.houseslevel) as 成盘 from houses h where h.houseslevel=2;
select
count(h.houseslevel) as 总数,
count(case when h.houseslevel=1 then h.housesid end ) 成盘 ,
count(case when h.houseslevel=2 then h.housesid end ) 比较盘
from houses h,areas a where h.areaid=a.areasid and h.houseslevel in (1,2)
SELECT a.areaname AS 二级地名,
count(a.houseId) AS 最新累计有效待售数,
count(h.houseslevel) AS 最新累计必卖盘,count(h2.houseslevel) AS 最新累计成盘 FROM houses h,houses h2,
areas a WHERE h.areaid=a.areasid AND h2.areaid=a.areasid AND h.finalassessmentid=1 AND h.houseslevel=2 AND h2.houseslevel=1 AND a.areasid!=a.parentareasid AND a.companysid=2;
SELECT a.areaname AS 二级地名 FROM houses h,areas a WHERE h.areaid=a.areasid AND a.areasid!=a.parentareasid
SELECT a.areaname AS 二级地名 FROM areas a where a.areaname=
select a.areaname AS 二级地名 from areas a
where a.areaname in (select b.areaname from areas b group by b.areaname having count(b.areaname) > 1)
select b.areaname as 二级地名,count(b.areaname) as 重复数据量 from areas b group by b.areaname having count(b.areaname) > 1
select h.houseslevel from houses h where h.houseslevel=1;
select a.areaname AS 二级地名 from houses h,areas a where h.areaid=h.areaid and h.houseslevel=1 and a.areasid!=a.parentareasid AND a.companysid=2 and h.finalassessmentid=1;
select a.areaname AS 二级地名,
count(h.houseslevel) as 总数,
count(case when h.houseslevel=1 then h.housesid end ) 成盘 ,
count(case when h.houseslevel=2 then h.housesid end ) 比较盘
from houses h,areas a where h.areaid=a.areasid and h.houseslevel in (1,2) and a.areasid!=a.parentareasid AND a.companysid=2 and h.finalassessmentid=1 and flag1=1 group by a.areaname;
oracle的sql积累..&..decode函数使用
标签:
本文系统来源:http://www.cnblogs.com/shunzdd/p/5585988.html
内容总结
以上是互联网集市为您收集整理的oracle的sql积累..&..decode函数使用全部内容,希望文章能够帮你解决oracle的sql积累..&..decode函数使用所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。