---
title: "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"
author: "ocaicai"
date: "2012-03-09T13:33:57Z"
tags: ["MySQL", "SQL", "limit"]
categories: ["数据库"]
slug: "this-version-of-mysql-doesn-t-yet-support-limit-in-all-any-some-subquery"
draft: false
lastmod: "2012-03-09T13:33:57Z"
id: 1447649
url: "https://ocaicai.iteye.com/blog/1447649"
---

```sql

SELECT id FROM t_play WHERE game_id IN (SELECT id FROM t_game LIMIT 0,10)

```


<span style="color:green">上面的SQL语句报错：错误码: 1235
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000

只需要如下修改就好：

</span>


```sql

SELECT id FROM t_play WHERE game_id IN (SELECT id FROM (SELECT id FROM t_game LIMIT 0,10)AS t)

```


<span style="color:green">至于原因不言而喻</span>




.