{"action":"opened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/11218","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/11218/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11218/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/11218/events","html_url":"https://github.com/yiisoft/yii2/issues/11218","id":144129817,"number":11218,"title":"query builder cannot use subquery in where with '< >' operators","user":{"login":"jpodpro","id":15255854,"avatar_url":"https://avatars.githubusercontent.com/u/15255854?v=3","gravatar_id":"","url":"https://api.github.com/users/jpodpro","html_url":"https://github.com/jpodpro","followers_url":"https://api.github.com/users/jpodpro/followers","following_url":"https://api.github.com/users/jpodpro/following{/other_user}","gists_url":"https://api.github.com/users/jpodpro/gists{/gist_id}","starred_url":"https://api.github.com/users/jpodpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpodpro/subscriptions","organizations_url":"https://api.github.com/users/jpodpro/orgs","repos_url":"https://api.github.com/users/jpodpro/repos","events_url":"https://api.github.com/users/jpodpro/events{/privacy}","received_events_url":"https://api.github.com/users/jpodpro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-29T01:43:47Z","updated_at":"2016-03-29T01:43:47Z","closed_at":null,"body":"consider this query:\r\n\r\n```sql\r\nSELECT comment.*\r\nFROM comment\r\nWHERE\r\n(\r\n    SELECT COUNT(*) FROM comment AS c\r\n    WHERE c.postId = comment.postId\r\n    AND c.timestamp >= comment.timestamp\r\n    ORDERY BY c.timestamp DESC\r\n) <= 5\r\nAND postId IN (42,43,44,35,8)\r\nORDER BY timestamp DESC\r\n```\r\n\r\nsince where( '<=' ... only accepts a column name and a specific value it appears that query builder cannot build this query."}}