MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

Posted by user198729 on Stack Overflow See other posts from Stack Overflow or by user198729
Published on 2010-02-22T06:27:19Z Indexed on 2010/04/08 18:03 UTC
Read the original article Hit count: 274

Filed under:
|
|
SELECT u.id AS u__id, 
       u.username AS u__username, 
       p.id AS p__id, 
       p.phonenumber AS p__phonenumber, 
       p.user_id AS p__user_id 
  FROM user u 
INNER JOIN phonenumber p ON u.id = p.user_id 
WHERE u.id IN (SELECT DISTINCT u2.id 
                 FROM user u2 
           INNER JOIN phonenumber p2 ON u2.id = p2.user_id 
                LIMIT 20)

This query is from here:

http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language

It's supposed to work on all DBMS ,but not in fact

© Stack Overflow or respective owner

Related posts about mysql

Related posts about limit