MySQL8子查询提示:This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery

水深无声 2023-10-10 13:02 98阅读 0赞

报错SQL:

  1. select ucas_individual_proj.individual_proj_name from ucas_individual_proj where ucas_individual_proj.sid in(
  2. select ucas_file_info.individual_proj_sid from ucas_file_info where ucas_file_info.individual_proj_sid is not null and ucas_file_info.pdf_path is not null limit 1, 10
  3. );

提示错误信息:

  1. 1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

正确SQL:子查询多嵌套一层

  1. select ucas_individual_proj.individual_proj_name from ucas_individual_proj where ucas_individual_proj.sid in(
  2. select t.individual_proj_sid from
  3. (select * from ucas_file_info where ucas_file_info.individual_proj_sid is not null and ucas_file_info.pdf_path is not null limit 1, 10) as t
  4. );

发表评论

表情:
评论列表 (有 0 条评论,98人围观)

还没有评论,来说两句吧...

相关阅读