MySQL Forums
Forum List  »  Newbie

[solved] This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
Posted by: Baptiste VALTHIER
Date: April 13, 2011 11:58AM

Hello everybody,

I'm trying to do something like that :
SELECT ft.*, fc.*
FROM forum_category fc 
LEFT JOIN forum_thread ft ON ft.E_id_category = fc.id
WHERE ft.id IN ( 
  SELECT ft2.id
  FROM forum_thread ft2
  WHERE ft2.E_id_category = fc.id
  ORDER BY ft2.id DESC
  LIMIT 5
)
ORDER BY fc.id, ft.id ASC

But this returns me the error "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery".

I want to get the 5 last threads of each of the categories. Is there a way to do that ?

Many thanks for your help.



Edited 1 time(s). Last edit at 04/14/2011 09:34AM by Baptiste VALTHIER.

Options: ReplyQuote


Subject
Written By
Posted
[solved] This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
April 13, 2011 11:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.