myfairys opened a new issue #15613:
URL: https://github.com/apache/shardingsphere/issues/15613


   it's version:4.1.0
   i use ShardingSphere-Proxy.
   
   when i use the sub query on select column, i can't get the correct result. i 
always get a result that the result column numbers is less one than select 
column. For example:
   i use this sql: 
   `SELECT
        im.id AS id,
        im.inquiry_code AS inquiryCode,
        im.visitor_id AS visitorId,
        im.content AS content,
        im.chat_box_mark AS chatBoxMark,
        im.access_user AS accessUser,
        im.STATUS AS STATUS,
        im.create_time AS createTime,
        im.update_time AS updateTime,
        im.top AS top,
        im.deleted AS deleted,
        im.user_type AS userType,
        b.content AS lastMessage
        ,(
        SELECT
                count(*) AS msg 
        FROM
                leshan_visitor_record 
        WHERE
                is_read = 0 
                AND im.inquiry_code = inquiry_code 
        GROUP BY
                inquiry_code 
        ) as msgcount,
        b.create_time AS lastRecordTime,
        'aaa' as aaa
   FROM
        im_inquiry im
        LEFT JOIN ( SELECT * FROM ( SELECT * FROM `leshan_visitor_record` ORDER 
BY create_time DESC LIMIT 10000 ) a GROUP BY a.inquiry_code ) b ON 
im.inquiry_code = b.inquiry_code`.
   
   **i can get result but don't have "aaa",and is that i use sub query on 
select column???**
   such as :
   `1   ZX202202231057001       12345   测试      GROUP-431401804259393537        
5       0       2022-02-23 10:57:15     2022-02-23 10:57:15     0       0       
0       测试      1       2022-02-23 10:57:15
   2    ZX202202231058001       123456  测试1                     0       
2022-02-23 10:58:49     2022-02-23 10:58:49     0       0       0       测试      
2       2022-02-24 10:58:49`
   and i don't know why happen.
   Can you tell me how to resolve this bug? Thanks.
   


-- 
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