--SQL/VMSCRIPT#set( $cnt = 10 )select $cnt;
--SQL/VMSCRIPT#set( $cnt = 10 )#set( $cnt = $cnt + 1 )select $cnt;
Operator | Operators | Sample code |
Object Equivalence | == | #if( $foo == $bar ) |
Not Equals | != | #if( $foo != $bar ) |
Less Than or Equal To | <= | #if( $foo <= 42 ) |
Less Than | < | #if( $foo < 42 ) |
Greater Than or Equal To | >= | #if( $foo >= 42 ) |
Greater Than | > | #if( $foo > 42 ) |
Equals String | == | #if( $foo == "bar" ) |
Equals Number | == | #if( $foo == 42 ) |
Boolean NOT | ! | #if( !$foo ) |
--SQL/VMSCRIPT#set( $cnt = 10 )#set( $cnt = $cnt + 1 )#foreach($i in $_range.of(1, $cnt, 1))select $cnt,$i;#end
--SQL/VMSCRIPT#foreach($table in ["test_user_info_table", "test_issue_info_table"])select '$table' table_name, count(1) cnt from $table where substring(create_time, 1, 7) = '2022-11'#if($foreach.last != true)union all#end#end
--SQL/VMSCRIPT--This statement will execute the branch where age>2#set( $flag_1 = 0 )#set( $flag_2 = 0 )select * from default.demo_hivewhere#if($flag_1 == 1)id = 1;#elseif( $flag_2 == 1)id = 2;#elseid >2;#end
--SQL/VMSCRIPT--This statement will execute the branch where age>2select * from default.demo_hivewhere#if(${flag_1} == 1)age = 1;#elseif(${flag_2} == 1)age = 2;#elseage >2;#end
--SQL/VMSCRIPT--This statement will execute the else branchselect * from default.user_infowhere#if(${is_reload} == "1")create_time <= ${dt};#elseif(${is_deltareload} == "1")create_time between ${dt_pre_7d} and ${dt};#elsecreate_time between ${dt_pre_1d} and ${dt};#end
Was this page helpful?