阿里P7也不过如此,被一个简单的SQL查询难住!
时间:2025-11-04 14:42:33 出处:应用开发阅读(143)

复制mysql> select * from user_score us -> innerjoin user_info ui on us.uid = ui.uid -> where us.id = 5; +----+-----------+-------+---------+-----------+---------+ | id | uid | score | id | uid | name | +----+-----------+-------+---------+-----------+---------+ | 5 | 111111111 | 100 | 1 | 111111111 | tanglei | | 5 | 111111111 | 100 | 3685399 | 111111111 | tanglei | | 5 | 111111111 | 100 | 3685400 | 111111111 | tanglei | | 5 | 111111111 | 100 | 3685401 | 111111111 | tanglei | | 5 | 111111111 | 100 | 3685402 | 111111111 | tanglei | | 5 | 111111111 | 100 | 3685403 | 111111111 | tanglei | +----+-----------+-------+---------+-----------+---------+ 6 rowsinset (0.00 sec) mysql> explain -> select * from user_score us -> innerjoin user_info ui on us.uid = ui.uid -> where us.id = 5; +----+-------------+-------+-------+-------------------+-----------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+-------------------+-----------+---------+-------+------+-------+ | 1 | SIMPLE | us | const | PRIMARY,阿里index_uid | PRIMARY | 4 | const | 1 | NULL | | 1 | SIMPLE | ui | ref | index_uid | index_uid | 194 | const | 6 | NULL | +----+-------------+-------+-------+-------------------+-----------+---------+-------+------+-------+ 2 rowsinset (0.00 sec) 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.
                分享到:
                
温馨提示:以上内容和图片整理于网络,仅供参考,希望对您有帮助!如有侵权行为请联系删除!