| |
doctrine-user |
http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctr...
Derek
On Jul 6, 3:23 am, mich <michaile...@gmail.com> wrote:
> On 3 июл, 22:58, mich <michaile...@gmail.com> wrote:
> > I want to execute such sql:
> > update blog_entry set comment_number = (select count(*) from
> > How I can write such query in DQL? I tried:
> > $q = Doctrine_Query::create()
> > but it throws exception "Unknown component alias Comment".
only report subquery support in FROM, SELECT, and WHERE statements.
Maybe it just plain doesn't work in SET, yet?
> > blog_comment where blog_comment.root = blog_entry.id)
> > ->update('Blog_Entry Entry')
> > ->set('Entry.comment_number', '(SELECT COUNT(Comment.id)
> > FROM Entry.Blog_Comment Comment WHERE Comment.root = Entry.id)')
> > ->execute()
> > ;