网管联盟 | 网管论坛 | 网管u家 | 网管博客 | 网管软件 | 网管求职 | 小游戏 | 网管搜索 | 网管原创 | 网管聚合 | 网管读摘 | 网管焦点 | 世界素材 | 会员投稿 | 会员中心 
中国网管联盟
Windows Linux Cisco 网络技术 数据库 黑客攻防 DotNet Java PHP 认证 新闻资讯 服务器 存储资讯 网络设备 网管学堂 技术专题 焦点 网吧频道
 当前位置: > bitsCN.com > 数据库技术 > Oracle > PL/SQL > Multiple在表中的计算  

Multiple在表中的计算

2005-11-23  作者:BitsCN整理  来源:中国网管联盟  点评 投稿 收藏


  create table myTable (
  this Varchar2(10),
  that Varchar2(10)
  );
  
  insert into myTable values ('that'   , 'the other');
  insert into myTable values ('confusing', 'the other');
  insert into myTable values ('this'   , 'that'   );
  insert into myTable values ('this'   , 'that'   );
  insert into myTable values ('that'   , 'confusing');
  insert into myTable values ('confusing', 'that'   );
  insert into myTable values ('confusing', 'confusing');
  insert into myTable values ('that'   , 'the other');
  insert into myTable values ('this'   , 'that'   );
  insert into myTable values ('confusing', 'the other');
  
  select
  count(
  case when
  this = 'that' and
  that = 'the other'
  then 1
  else null end) "Count 1",
  count(
  case when
  this = 'this' and
  that = 'that'
  then 1
  else null end) "Count 2",
  count(
  case when
网管u家www.bitscn.net

  this = 'confusing'
  then 1
  else null end) "Count 3"
  from
  myTable;
TAGs计算   that   insertintomyTablevalues   confusing   this   theother    
 上一篇:Oracle SQL中的RANK   下一篇:Oracle 9i取得建表和索引
相关文章列表
Multiple在表中的计算 评论:
loading.. 评论加载中…
评论:请自觉遵守互联网相关政策法规,评论不得超过250字。

验证码: 注册用户
本类热门排行:
1.PL/SQL - 嵌套游标 cursor-PLSQL
2.用一个实例讲解Oracle数据库的PL/SQL语句
3.PL/SQL----触发器-PLSQL
4.mysql存储过程写法—动态参数运用-PLSQL
5.PL/SQL Developer导出分区索引脚本-PLSQL
6.PL/SQL collection— table() 函数-PLSQL
7.SQL Server 2005 中的架构与用户-PLSQL
8.Oracle数据库维护常用SQL语句集合(2)-P
9.Oracle数据库维护常用SQL语句集合(3)-P
10.再议SQL Server临时表和表变量-PLSQL
最新推荐文章:
1.与数据库无关的处理放到数据库以外来实现
2.Oracle 10g第2版新特性之SQL和PL/SQL
3.通过PL/SQL访问Web Services
4.菜鸟学oracle - 用PL/SQL画直方图
5.重新编译PLSQL中无效对象或指定对象
6.Oracle高级技巧
7.深入了解Oracle 10g新的多重集运算符
8.在SQL中删除重复记录(多种方法)
9.Oracle:PL/SQL中怎样使用Array
10.数据库手册:速查Oracle函数列表
网管论坛交流:
·大家来开心一下吧---看了会很开心的东西-
·中国人不可不知道的知识
·@@小鹏◎◎小鹏同志与某位女明星亲密接触
·◎◎小鹏◎◎发现不明生物,居然正在交配
·[图文]^^^版主是什么?????
·泡论坛的女人是好女人
·做个“水性杨花”的女人
·献给mm俱乐部的所有mm
·深圳一集团企业电脑基础应用培训教程
·■■■■十一遊玩照■■■■■