数据库2025年07月06日
1、 INSERT INTO table_xxx(x1,x2,x3,x4)SELECT y1,y2,y3,y4 FROM TABLE_yyy WHERE CASE WHEN y5 = m5 THEN y6 = m61 ELSE y6 = m62 END AND y7 = m7; 2、 INSERT INTO table_xxx(x1,x2,x3,x4)SE...
后端开发2025年06月29日
Ruby的case语句 case语句使用的是===判断方式,可以进行更加广义的相等判断; 可以进行类型的判断,可以进行正则表达式的判断; array = ["a",1,nil] array.each { |ai| case ai when String puts "#{ai} is string" when Numeric puts "#{ai} is n...
数据库2025年05月03日
case when 用法 (1)简单case函数:格式: case 列名 when 条件值1 then 选项1 when 条件值1 then 选项2...... else 默认值 end 例如: select case job_level when '1' then '1111' when '2' then '2222' when '3' then '33...