case使用例子】的更多相关文章

echo 'Input a number between 1 to 4' echo 'Your number is:\c' read aNum case $aNum in 1) echo 'You select 1' ;; 2) echo 'You select 2' ;; 3) echo 'You select 3' ;; 4) echo 'You select 4' ;; *) echo 'You do not select a number between 1 to 4' ;; esac…
DATA: gv_1 TYPE c. DATA: gv_2 TYPE i. gv_2 = 60. IF gv_2 >= 0 AND gv_2 < 60 . gv_1 = 'A'. ELSEIF gv_2 >= 60 AND gv_2 < 70. gv_1 = 'B'. ELSEIF gv_2 >= 70 AND gv_2 < 80. gv_1 = 'C'. ELSEIF gv_2 >= 80 AND gv_2 < 90. gv_1 = 'D'. ELSEIF…
module ex_case `timescale lns/1ns module ex_case( input wire rst_n, input wire sclk, output reg [7:0] o_dv, output reg [7:0] o_data, //数据输入 input wire [9:0] i_data, input wire [7:0] i_addr ); // reg [2:0] cnt_7; //不同功能的寄存器分开always来写,这样代码的可维护性强,可读性强 a…
关于 游标 if,for 的例子 create or replace procedure peace_if is cursor var_c is select * from grade; begin for temp in var_c loop if temp.course_name = 'OS' then dbms_output.put_line('Stu_name = '||temp.stu_name); elsif temp.course_name = 'DB' then dbms_out…
使用case...when语句进行判断,其语法格式如下: case<selector> when<expression_1> then pl_sqlsentence_1; when<expression_2> then pl_sqlsentence_2; ... when<expression_n> then pl_sqlsentence_n; [else plsql_sentence;] end case; 具体例子如下: declare v_season…
SELECT a.hsid, a.house_code, a.sale_date, a.pjid, COUNT( sdid ) AS num, b.hsid, b.pscid, b.hscode, b.hsarea1, b.hsrealarea1, b.hsusage, b.hsprice, b.hsstatus,sum(CASE WHEN b.hsrealarea1 >0THEN b.hsrealarea1ELSE b.hsarea1END)  as c , c.xzarea, c.lpmc,…
关于 游标 if,for 的例子 create or replace procedure peace_if is cursor var_c is select * from grade; begin for temp in var_c loop if temp.course_name = 'OS' then dbms_output.put_line('Stu_name = '||temp.stu_name); elsif temp.course_name = 'DB' then dbms_out…
1.简单的一个case when 例子: CASE sex ' THEN '男' ' THEN '女' ELSE '其他' END 2. case when 在一整个表为空强行让其显示出一个值,在其后加上一个count(1),强行让其显示一行,不然一整个表为空时,case when 做判断不生效 ) ' AND cc.cname='A' 3.在 做一个订单时效,订单时效需要用KPI时间与实际到达时间进行比较,且有三个状态: 超时状态 * 是否大于KPI所需要的到达时间* 1.大于(未跟踪)* 2…
#!/bin/bash read -p "input a dight:"echo $REPLY DATE=`date`echo "DATE is ${DATE}" USERS=`who |wc -l`echo "LOGIN in user is ${USERS}" UP=`date;uptime`echo "Uptime is ${UP}" #echo "HELLO World!" #echo "…
#!/bin/bash read -p "input a dight:"echo $REPLY DATE=`date`echo "DATE is ${DATE}" USERS=`who |wc -l`echo "LOGIN in user is ${USERS}" UP=`date;uptime`echo "Uptime is ${UP}" #echo "HELLO World!" #echo "…