6)if判断语句
  if ... then
  else
  end if;
 
  if ... then
  elsif ... then
  elsif ... then
  else
  end if;
 
  declare
    sex char(1) := 'M';
  begin
    if sex='M' then
     dbms_output.put_line('支持文章');
    elsif sex='F'then
     dbms_output.put_line('支持马伊琍');
    else
     dbms_output.put_line('支持姚笛');
    end if;
  end;
  /
 
//有一个NUMBER(3)变量,
如果大于0显示1;
如果小于0显示-1;
如果等于0显示0;
declare
  n number(3) :=10;
begin
  if n>0 then
    dbms_output.put_line(1);
  elsif n<0 then
    dbms_output.put_line(-1);
  else
    dbms_output.put_line(0);
  end if;
end;
/

if判断语句的更多相关文章

  1. SQLite的时候判断语句是否纯在:出现RuntimeException

    写SQLite的时候判断语句是否纯在: public boolean exist(long id) { String filter = FRIEND_KEY_ID + "=" + ...

  2. 第二周:If判断语句程序当中的作用简介

    1.If语句的作用: 在我们编写程序时经常会遇到内容判断的问题,比如判断内容的真假或者值的大小分别输出内容的问题 这时就会用到我们的If判断语句了,顾名思义,if在英文单词中意思为如果,在Java中他 ...

  3. 关于JavaScript的判断语句(1)

    if语句: if( 判断条件 ){ 判断结果为true执行语句: } if...else语句: if(判断条件){ 判断结果为true时执行的语句: }else{ 判断结果为false时执行语句: } ...

  4. SQL判断语句用法和多表查询

    1.格式化时间sql语句 本例中本人随便做了两张表,和实际不是很相符,只是想说明sql语句的写法. 例1表格式如下: 需求:查询出本表,但需要使time字段的时间格式为yyyy-MM-dd,比如:20 ...

  5. VB的判断语句和循环语句

      判断语句 •If语句 if语句共有4种写法: 第一种语法: If 条件判断语句 then 程序代码 第二种语法:If 条件判断语句 then 程序代码 else 程式代码 第三种语法: If 条件 ...

  6. Interview----求 1+2+...+n, 不能用乘除法、for、while if、else、switch、case 等关键字以及条件判断语句 (A?B:C)

    题目描述: 求 1+2+...+n, 要求不能使用乘除法.for.while.if.else.switch.case 等关键字以及条件判断语句 (A?B:C). 分析: 首先想到的是写递归函数,但是遇 ...

  7. 求1+2+…+n,要求不能使用乘除法、for、while、if、else、s witch、case 等关键字以及条件判断语句(A?B:C)和不用循环/goto/递归输出1~100的10种写法

    来源:据说是某一年某个公司的面试题 题目:求1+2+…+n, 要求不能使用乘除法.for.while.if.else.s witch.case 等关键字以及条件判断语句(A?B:C) 分析:这题本来很 ...

  8. aspcms中if判断语句的运用

    1.<h3 {if:"[list:isrecommend]"="1"} style="color:red;"{end if}>& ...

  9. if条件判断语句的不同

    let number = ["a":1, "b":2, "c":3]; if let num = number["d"] ...

  10. shell编程基础(3)条件判断语句

    1,带参数的shellscript #this is program build 5.11 to test shell script ############ cxz ####### 5.11 ### ...

随机推荐

  1. C++ constexpr类型说明符

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/50864210 关键字 constexp ...

  2. 仿照CIFAR-10数据集格式,制作自己的数据集

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/50801226 前一篇博客:C/C++ ...

  3. HDU 2857 Mirror and Light

    /* hdu 2857 Mirror and Light 计算几何 镜面反射 */ #include<stdio.h> #include<string.h> #include& ...

  4. ASP.NET--identity笔记及截图

    aspnetUsers aspnetRoles aspnetUserroles aspnetUserClaims 存储用户user额外信息的键值对 aspnetUserLogins 第三方登陆的控件 ...

  5. http格式(graph)

    http请求格式 http请求头 字段 http响应 http响应头字段

  6. hdu 1165 Eddy&#39;s research II(数学题,递推)

    // Eddy 继续 Problem Description As is known, Ackermann function plays an important role in the sphere ...

  7. 2016.03.28,英语,《Vocabulary Builder》Unit 07

    vis: comes from a Latin verb meaning 'see'. vision: ['vɪʒn] n. 视觉,先见之明,光景,视力,眼力,幻想,影像 vt. 幻想. ; vid- ...

  8. ubuntu 使用阿里云 apt 源

    以下内容来自 https://opsx.alibaba.com/mirror Ubuntu对应的“帮助”信息 修改方式:打开 /et/apt/sources.list 将http://archive. ...

  9. Navicat 连接 Mysql 报2059错误的原因以及解决方法

    MySQL的8.0.*版本使用的是caching_sha2_password验证方式,而Navicat Premium 12还不支持该种方式.解决方案: 1,降低mysql的版本 2,设置mysql支 ...

  10. div position:fixed后,水平居中的问题

    .div{position:fixed;margin:auto;left:0; right:0; top:0; bottom:0;width:200px; height:150px;}