Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:09:24+00:00 2026-06-07T03:09:24+00:00

is it possible to get data with a subselect in dql and putting the

  • 0

is it possible to get data with a subselect in dql and putting the result in a class attribute which is not a entity column?

hasfreelist is a class attribute but not a entity column in mysql.

This is my dql:

SELECT e, DATE(e.begin) dbegin, 
(SELECT COUNT(g) FROM AcmeDemoBundle:list  g WHERE e.id = g.fkevent) AS e.hasfreelists     
FROM AcmeDemoBundle:event e JOIN e.fklocation l 
WHERE e.enabled=1 e.begin>=:from 
ORDER BY dbegin, e.topevent DESC

I have the following error:

An exception has been thrown during the rendering of a template 
("[Syntax Error] line 0, col 143: Error: 
Expected Doctrine\ORM\Query\Lexer::T_FROM, got '.'")

But it tells me nothing.
Thank you for you help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:09:25+00:00Added an answer on June 7, 2026 at 3:09 am

    Seems to me you can define an association between Event and List, and use the SIZE function to add your select. Much easier and logical that way:

    SELECT e, DATE(e.begin) AS dbegin, SIZE(e.lists) AS number_of_lists
    FROM [...]
    

    You can still define a hasFreeList method on your entity class, which would return sizeof($this->lists) > 0.

    But the reason you are getting this error, I think, is because you define your subselect as e.hasfreelist. While it is a property of your class, this is a DQL syntax error (should be (SELECT x FROM y) AS z). Also, your Date select lacks the AS operator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to get data from external bluetooth device(not iphone) to iphone(bluetooth sensor
is it possible to Get data from an excel sheet which are watir commands
Possible Duplicate: Get image data in Javascript? Hello, I've got a single div, which
Is it possible to get data from remote server using JUST TSQL? I mean
is it to possible to get data from grayscale png with fopen and then
Possible Duplicate: Get image data in Javascript? Convert an image into binary data in
Is it possible for a web page using Javascript to get data from another
It's possible to get the source of the location data (for example GPS receiver,
Anybody know if it's possible? I'm trying to get the data by using the
Is it possible with the public app API to get data such as when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.