|
4881 | 4881 | </expression-projection>
|
4882 | 4882 | </projections>
|
4883 | 4883 | </select>
|
4884 |
| - |
| 4884 | + |
4885 | 4885 | <select sql-case-id="select_prediction_cost">
|
4886 | 4886 | <projections distinct-row="false" start-index="7" stop-index="13">
|
4887 | 4887 | <column-projection name="cust_id" start-delimiter="" end-delimiter="" start-index="7" stop-index="13"/>
|
|
4910 | 4910 | </expression-item>
|
4911 | 4911 | </order-by>
|
4912 | 4912 | </select>
|
| 4913 | + |
| 4914 | + <select sql-case-id="select_name_const"> |
| 4915 | + <projections start-index="7" stop-index="29"> |
| 4916 | + <expression-projection start-index="7" stop-index="29" text="NAME_CONST('myname',14)"> |
| 4917 | + <expr> |
| 4918 | + <function start-index="7" stop-index="29" function-name="NAME_CONST" text="NAME_CONST('myname',14)"> |
| 4919 | + <parameter> |
| 4920 | + <literal-expression value="myname" start-index="18" stop-index="25"/> |
| 4921 | + </parameter> |
| 4922 | + <parameter> |
| 4923 | + <literal-expression value="14" start-index="27" stop-index="28"/> |
| 4924 | + </parameter> |
| 4925 | + </function> |
| 4926 | + </expr> |
| 4927 | + </expression-projection> |
| 4928 | + </projections> |
| 4929 | + </select> |
| 4930 | + |
| 4931 | + <select sql-case-id="select_not_in"> |
| 4932 | + <projections start-index="7" stop-index="33"> |
| 4933 | + <expression-projection start-index="7" stop-index="33" text="3,4) NOT IN ((1,2), (3,4)"> |
| 4934 | + <expr> |
| 4935 | + <in-expression start-index="7" stop-index="33"> |
| 4936 | + <left> |
| 4937 | + <row-expression start-index="7" stop-index="11" text="(3,4)"> |
| 4938 | + <items> |
| 4939 | + <literal-expression start-index="8" stop-index="8" value="3" /> |
| 4940 | + </items> |
| 4941 | + <items> |
| 4942 | + <literal-expression start-index="10" stop-index="10" value="4" /> |
| 4943 | + </items> |
| 4944 | + </row-expression> |
| 4945 | + </left> |
| 4946 | + <not>true</not>> |
| 4947 | + <right> |
| 4948 | + <list-expression start-index="20" stop-index="33"> |
| 4949 | + <items> |
| 4950 | + <row-expression start-index="21" stop-index="25" text="(1,2)" > |
| 4951 | + <items> |
| 4952 | + <literal-expression start-index="22" stop-index="22" value="1"/> |
| 4953 | + </items> |
| 4954 | + <items> |
| 4955 | + <literal-expression start-index="24" stop-index="24" value="2"/> |
| 4956 | + </items> |
| 4957 | + </row-expression> |
| 4958 | + </items> |
| 4959 | + <items> |
| 4960 | + <row-expression start-index="28" stop-index="32" text="(3,4)" > |
| 4961 | + <items> |
| 4962 | + <literal-expression start-index="29" stop-index="29" value="3"/> |
| 4963 | + </items> |
| 4964 | + <items> |
| 4965 | + <literal-expression start-index="31" stop-index="31" value="4"/> |
| 4966 | + </items> |
| 4967 | + </row-expression> |
| 4968 | + </items> |
| 4969 | + </list-expression> |
| 4970 | + </right> |
| 4971 | + </in-expression> |
| 4972 | + </expr> |
| 4973 | + </expression-projection> |
| 4974 | + </projections> |
| 4975 | + </select> |
| 4976 | + |
| 4977 | + <select sql-case-id="select_not_like"> |
| 4978 | + <projections start-index="7" stop-index="37"> |
| 4979 | + <expression-projection start-index="7" stop-index="37" text="'hello world' NOT LIKE '%test%'"> |
| 4980 | + <expr> |
| 4981 | + <binary-operation-expression start-index="7" stop-index="37" text="'hello world' NOT LIKE '%test%'"> |
| 4982 | + <left> |
| 4983 | + <literal-expression start-index="7" stop-index="19" value="hello world" /> |
| 4984 | + </left> |
| 4985 | + <operator>NOT LIKE</operator> |
| 4986 | + <right> |
| 4987 | + <list-expression start-index="30" stop-index="37"> |
| 4988 | + <items> |
| 4989 | + <literal-expression start-index="30" stop-index="37" value="%test%"/> |
| 4990 | + </items> |
| 4991 | + </list-expression> |
| 4992 | + </right> |
| 4993 | + </binary-operation-expression> |
| 4994 | + </expr> |
| 4995 | + </expression-projection> |
| 4996 | + </projections> |
| 4997 | + </select> |
| 4998 | + |
| 4999 | + <select sql-case-id="select_now"> |
| 5000 | + <projections start-index="7" stop-index="11"> |
| 5001 | + <expression-projection start-index="7" stop-index="11" text="NOW()"> |
| 5002 | + <expr> |
| 5003 | + <function function-name="NOW" start-index="7" stop-index="11" text="NOW()" /> |
| 5004 | + </expr> |
| 5005 | + </expression-projection> |
| 5006 | + </projections> |
| 5007 | + </select> |
| 5008 | + |
| 5009 | + <select sql-case-id="select_nth_value"> |
| 5010 | + <from> |
| 5011 | + <simple-table start-index="80" stop-index="88" name="employees"/> |
| 5012 | + </from> |
| 5013 | + <projections start-index="7" stop-index="73"> |
| 5014 | + <expression-projection start-index="7" stop-index="73" alias="third_highest_salary" text="NTH_VALUE(salary, 3) OVER (ORDER BY salary)" > |
| 5015 | + <expr> |
| 5016 | + <function function-name="NTH_VALUE" start-index="7" stop-index="49" text="NTH_VALUE(salary, 3) OVER (ORDER BY salary)"> |
| 5017 | + <parameter> |
| 5018 | + <column start-index="17" stop-index="22" name="salary"/> |
| 5019 | + </parameter> |
| 5020 | + <parameter> |
| 5021 | + <literal-expression start-index="25" stop-index="25" value="3"/> |
| 5022 | + </parameter> |
| 5023 | + </function> |
| 5024 | + </expr> |
| 5025 | + </expression-projection> |
| 5026 | + </projections> |
| 5027 | + </select> |
| 5028 | + |
| 5029 | + <select sql-case-id="select_nullif"> |
| 5030 | + <projections start-index="7" stop-index="17"> |
| 5031 | + <expression-projection start-index="7" stop-index="17" text="NULLIF(1,1)"> |
| 5032 | + <expr> |
| 5033 | + <function function-name="NULLIF" start-index="7" stop-index="17" text="NULLIF(1,1)"> |
| 5034 | + <parameter> |
| 5035 | + <literal-expression start-index="14" stop-index="14" value="1"/> |
| 5036 | + </parameter> |
| 5037 | + <parameter> |
| 5038 | + <literal-expression start-index="16" stop-index="16" value="1"/> |
| 5039 | + </parameter> |
| 5040 | + </function> |
| 5041 | + </expr> |
| 5042 | + </expression-projection> |
| 5043 | + </projections> |
| 5044 | + </select> |
| 5045 | + |
| 5046 | + <select sql-case-id="select_oct"> |
| 5047 | + <projections start-index="7" stop-index="13"> |
| 5048 | + <expression-projection start-index="7" stop-index="13" text="OCT(12)"> |
| 5049 | + <expr> |
| 5050 | + <function function-name="OCT" start-index="7" stop-index="13" text="OCT(12)"> |
| 5051 | + <parameter> |
| 5052 | + <literal-expression start-index="11" stop-index="12" value="12"/> |
| 5053 | + </parameter> |
| 5054 | + </function> |
| 5055 | + </expr> |
| 5056 | + </expression-projection> |
| 5057 | + </projections> |
| 5058 | + </select> |
| 5059 | + |
| 5060 | + <select sql-case-id="select_octet_length"> |
| 5061 | + <projections start-index="7" stop-index="26"> |
| 5062 | + <expression-projection start-index="7" stop-index="26" text="OCTET_LENGTH('text')"> |
| 5063 | + <expr> |
| 5064 | + <function function-name="OCTET_LENGTH" start-index="7" stop-index="26" text="OCTET_LENGTH('text')"> |
| 5065 | + <parameter> |
| 5066 | + <literal-expression start-index="20" stop-index="25" value="text"/> |
| 5067 | + </parameter> |
| 5068 | + </function> |
| 5069 | + </expr> |
| 5070 | + </expression-projection> |
| 5071 | + </projections> |
| 5072 | + </select> |
| 5073 | + |
| 5074 | + <select sql-case-id="select_ord"> |
| 5075 | + <projections start-index="7" stop-index="14"> |
| 5076 | + <expression-projection start-index="7" stop-index="14" text="ORD('2')"> |
| 5077 | + <expr> |
| 5078 | + <function function-name="ORD" start-index="7" stop-index="14" text="ORD('2')"> |
| 5079 | + <parameter> |
| 5080 | + <literal-expression start-index="11" stop-index="13" value="2"/> |
| 5081 | + </parameter> |
| 5082 | + </function> |
| 5083 | + </expr> |
| 5084 | + </expression-projection> |
| 5085 | + </projections> |
| 5086 | + </select> |
| 5087 | + |
| 5088 | + <select sql-case-id="select_period_add"> |
| 5089 | + <projections start-index="7" stop-index="26"> |
| 5090 | + <expression-projection start-index="7" stop-index="26" text="PERIOD_ADD(200801,2)"> |
| 5091 | + <expr> |
| 5092 | + <function function-name="PERIOD_ADD" start-index="7" stop-index="26" text="PERIOD_ADD(200801,2)"> |
| 5093 | + <parameter> |
| 5094 | + <literal-expression start-index="18" stop-index="23" value="200801"/> |
| 5095 | + </parameter> |
| 5096 | + <parameter> |
| 5097 | + <literal-expression start-index="25" stop-index="25" value="2"/> |
| 5098 | + </parameter> |
| 5099 | + </function> |
| 5100 | + </expr> |
| 5101 | + </expression-projection> |
| 5102 | + </projections> |
| 5103 | + </select> |
| 5104 | + |
| 5105 | + <select sql-case-id="select_period_diff"> |
| 5106 | + <projections start-index="7" stop-index="32"> |
| 5107 | + <expression-projection start-index="7" stop-index="32" text="PERIOD_DIFF(200802,200703)"> |
| 5108 | + <expr> |
| 5109 | + <function function-name="PERIOD_DIFF" start-index="7" stop-index="32" text="PERIOD_DIFF(200802,200703)"> |
| 5110 | + <parameter> |
| 5111 | + <literal-expression start-index="19" stop-index="24" value="200802"/> |
| 5112 | + </parameter> |
| 5113 | + <parameter> |
| 5114 | + <literal-expression start-index="26" stop-index="31" value="200703"/> |
| 5115 | + </parameter> |
| 5116 | + </function> |
| 5117 | + </expr> |
| 5118 | + </expression-projection> |
| 5119 | + </projections> |
| 5120 | + </select> |
| 5121 | + |
| 5122 | + <select sql-case-id="select_percent_rank"> |
| 5123 | + <from> |
| 5124 | + <simple-table start-index="50" stop-index="58" name="employees"/> |
| 5125 | + </from> |
| 5126 | + <projections start-index="7" stop-index="43"> |
| 5127 | + <expression-projection start-index="7" stop-index="43" text="PERCENT_RANK() OVER (ORDER BY salary)" > |
| 5128 | + <expr> |
| 5129 | + <function function-name="PERCENT_RANK" start-index="7" stop-index="43" text="PERCENT_RANK() OVER (ORDER BY salary)"/> |
| 5130 | + </expr> |
| 5131 | + </expression-projection> |
| 5132 | + </projections> |
| 5133 | + </select> |
| 5134 | + |
| 5135 | + <select sql-case-id="select_pi"> |
| 5136 | + <projections start-index="7" stop-index="10"> |
| 5137 | + <expression-projection start-index="7" stop-index="10" text="PI()"> |
| 5138 | + <expr> |
| 5139 | + <function function-name="PI" start-index="7" stop-index="10" text="PI()"/> |
| 5140 | + </expr> |
| 5141 | + </expression-projection> |
| 5142 | + </projections> |
| 5143 | + </select> |
| 5144 | + |
| 5145 | + <select sql-case-id="select_regexp" > |
| 5146 | + <projections start-index="7" stop-index="25"> |
| 5147 | + <expression-projection start-index="7" stop-index="25" text="'a' REGEXP '^[a-d]'"> |
| 5148 | + <expr> |
| 5149 | + <binary-operation-expression start-index="7" stop-index="25" text="'a' REGEXP '^[a-d]'"> |
| 5150 | + <left> |
| 5151 | + <literal-expression start-index="7" stop-index="9" value="a"/> |
| 5152 | + </left> |
| 5153 | + <operator>REGEXP</operator> |
| 5154 | + <right> |
| 5155 | + <literal-expression start-index="18" stop-index="25" value="^[a-d]"/> |
| 5156 | + </right> |
| 5157 | + </binary-operation-expression> |
| 5158 | + </expr> |
| 5159 | + </expression-projection> |
| 5160 | + </projections> |
| 5161 | + </select> |
4913 | 5162 | </sql-parser-test-cases>
|
0 commit comments