例
1 # strは、["str", "str2"]に含まれているのでtrue 2 "str" in ["str", "str2"] 3 4 # strは、["str1", "str2"]に含まれていないのでfalse 5 "str" in ["str1", "str2"]
1 # strは、["str", "str2"]に含まれているのでtrue 2 "str" in ["str", "str2"] 3 4 # strは、["str1", "str2"]に含まれていないのでfalse 5 "str" in ["str1", "str2"]
1 select 1
1 select sysdatetime(); 2 select len('12345');
1 month_name = switch month 2 when 1 3 'January' 4 when 2 5 'February' 6 when 3 7 'March' 8 when 4 9 'April' 10 else 11 'other'
1 month_name = (function() { 2 switch (month) { 3 case 1: 4 return 'January'; 5 case 2: 6 return 'February'; 7 case 3: 8 return 'March'; 9 case 4: 10 return 'April'; 11 default: 12 return 'other'; 13 } 14 })();
1 season = switch month 2 when 12, 1, 2 3 "冬" 4 when 3, 4, 5 5 "春" 6 when 6, 7, 8 7 "夏" 8 when 9, 10, 11 9 "秋" 10 else 11 "不明" 12 console.log(season)
1 season = (function() { 2 switch (month) { 3 case 12: 4 case 1: 5 case 2: 6 return "冬"; 7 case 3: 8 case 4: 9 case 5: 10 return "春"; 11 case 6: 12 case 7: 13 case 8: 14 return "夏"; 15 case 9: 16 case 10: 17 case 11: 18 return "秋"; 19 default: 20 return "不明"; 21 } 22 })();