TherChenYang commented on issue #31236:
URL: 
https://github.com/apache/shardingsphere/issues/31236#issuecomment-2115102409

   @xigongxiaoche You claim there are obvious errors here, the WHERE clause is 
in the subquery; the correct assertion should be
   ```xml
   <select sql-case-id="select_interval_with_subquery">
           <projections start-index="7" stop-index="9">
               <column-projection name="age" start-index="7" stop-index="9"/>
           </projections>
           <from>
               <subquery-table>
                   <subquery>
                       <select>
                           <projections start-index="24" stop-index="64">
                               <expression-projection text="0-1岁" 
start-index="24" stop-index="33" alias="age"/>
                               <aggregation-projection type="COUNT" 
start-index="35" stop-index="42" expression="count(*)" alias="countNum"/>
                               <expression-projection text="0" start-index="54" 
stop-index="64" alias="sortNum"/>
                           </projections>
                           <from start-index="71" stop-index="91">
                               <simple-table name="T_EMPI_PATIENT_INFO" 
start-index="71" stop-index="91" alias="t"/>
                           </from>
                           <where start-index="93" stop-index="161">
                               <expr>
                                   <binary-operation-expression 
start-index="99" stop-index="161">
                                       <operator>&gt;</operator>
                                       <left>
                                           <column name="birth" 
start-index="99" stop-index="105">
                                               <owner name="t" start-index="99" 
stop-index="99"/>
                                           </column>
                                       </left>
                                       <right>
                                           <function text="to_char((sysdate - 
interval '1' year(3)), 'yyyymmdd')" function-name="to_char" start-index="109" 
stop-index="161">
                                               <parameter>
                                                   <binary-operation-expression 
start-index="118" stop-index="147">
                                                       <operator>-</operator>
                                                       <left>
                                                           <column 
name="sysdate" start-index="118" stop-index="124"/>
                                                       </left>
                                                       <right>
                                                           <common-expression 
text="interval '1' year(3)" start-index="128" stop-index="147"/>
                                                       </right>
                                                   
</binary-operation-expression>
                                               </parameter>
                                               <parameter>
                                                   <literal-expression 
value="yyyymmdd" start-index="151" stop-index="160"/>
                                               </parameter>
                                           </function>
                                       </right>
                                   </binary-operation-expression>
                               </expr>
                           </where>
                       </select>
                   </subquery>
               </subquery-table>
           </from>
       </select>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to