Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Can you use sub queries with phql?

This piece of working sql gives me the position of an item in the subquery:

SELECT x.position
FROM
(SELECT ftp.topic_id, ftp.id as id, @rownum := @rownum + 1 AS position
 FROM forum_topic_post ftp
 JOIN (SELECT @rownum := 0) r
 where ftp.topic_id = 11134
 ORDER BY ftp.id ASC) as x
where x.id = 310781

Is it possible now to transpose this into phql as previous reading has told me this is not possible.



99.6k
Accepted
answer

Not like those, those are not supported, only subqueries to select column value are supported.