1.条件判断语句 If Then Else Sub judge(x) Then MsgBox "the num is 0" Then MsgBox "the num is 1" Then MsgBox "the num is 2" Else MsgBox "the num is other" End If End Sub judge() 2.Select case Sub sel(x) Select case x MsgBox
if语句 计算机之所以能做很多自动化的任务,因为它可以自己做条件判断. 比如,输入用户年龄,根据年龄打印不同的内容,在Python程序中,可以用if语句实现: age = 20 if age >= 18: print 'your age is', age print 'adult' print 'END' 注意: Python代码的缩进规则.具有相同缩进的代码被视为代码块,上面的3,4行 print 语句就构成一个代码块(但不包括第5行的print).如果 if 语句判断为 True,就会执行这
在学习JavaScript中的if控制语句和switch控制语句的时候,提到了使用多条件判断时switch case语句比if语句效率高,但是身为小白的我并没有在代码中看出有什么不同.去度娘找了半个小时,看了各位大神的表述,找到一个比较清晰的文章. 原来,switch进行了跳转优化,java中对switch有两种处理方式,生成不同的jvm指令,一是tableswitch,一个是lookupswitch.对于case的分支比较密集的情况,如: public class Test { public
select * from td left join (select case_id as sup_case_id , count(*) supervise_number from td_kcdc_case_sup_info group by case_id ) sup on sup.sup_case_id = td.case_id where 1=1 /*不能去掉, 否则认为and 后的条件为 联合查询时的条件, 不能起过滤作用,由于left join因此td表中记录将全
转自:http://blog.csdn.net/muxiaoshan/article/details/7617533 select * from td left join (select case_id as sup_case_id , count(*) supervise_number from td_kcdc_case_sup_info group by case_id ) sup on sup.sup_case_id = td.case_id where 1=1 /*