Discussion:
dbal : subquery
safraoui karim
2014-03-24 02:53:37 UTC
Permalink
Hi,

Can i do subquery using dql ?
ex :
select
x.*,
f.*
from
(
select a.* from a
) as x
join f on f.id=x.id
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Marco Pivetta
2014-03-24 04:15:53 UTC
Permalink
Hi Sefraoui,

This is not supported by the ORM. If you need to filter in subqueries, then
do so in the WHERE clause.


Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/
Post by safraoui karim
Hi,
Can i do subquery using dql ?
select
x.*,
f.*
from
(
select a.* from a
) as x
join f on f.id=x.id
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Nima Sadjadi
2014-03-24 14:11:17 UTC
Permalink
Marco, I think he wants to do it with dbal, not with orm as you said!
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
safraoui karim
2014-03-24 23:22:21 UTC
Permalink
Nima Sadjadi,
yes , i want to use dbal :)
Post by Nima Sadjadi
Marco, I think he wants to do it with dbal, not with orm as you said!
--
You received this message because you are subscribed to a topic in the
Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/doctrine-user/sYRtEFkVxQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Nima Sadjadi
2014-03-24 23:25:36 UTC
Permalink
Hi,

Sorry I a, newbie and cannot help you. just noticed Marco understood you
wrongly,
Post by safraoui karim
Nima Sadjadi,
yes , i want to use dbal :)
Post by Nima Sadjadi
Marco, I think he wants to do it with dbal, not with orm as you said!
--
You received this message because you are subscribed to a topic in the
Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/doctrine-user/sYRtEFkVxQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Marco Pivetta
2014-03-25 00:38:22 UTC
Permalink
Well, with DBAL, you'd just throw that SQL at your Doctrine\DBAL\Connection
instance... The Question asked about "DQL", which is the ORM DSL for
querying.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/
Post by Nima Sadjadi
Hi,
Sorry I a, newbie and cannot help you. just noticed Marco understood you
wrongly,
Post by safraoui karim
Nima Sadjadi,
yes , i want to use dbal :)
Post by Nima Sadjadi
Marco, I think he wants to do it with dbal, not with orm as you said!
--
You received this message because you are subscribed to a topic in the
Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/doctrine-user/sYRtEFkVxQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
safraoui karim
2014-03-25 10:45:54 UTC
Permalink
Well,
im asking about that :

$queryBuilder
->select('u.id', 'u.name')
->from('users', 'u')
->where('u.email = ?')
->setParameter(0, $userInputEmail)


i know that expr() dosent allow select from :)

$queryBuilder
->select('u.id', 'u.name')
->expr()->( select(xxx)->from(yyy0 )->join('users', 'u')
->where('u.email = ?')
->setParameter(0, $userInputEmail)



and
Post by Marco Pivetta
Well, with DBAL, you'd just throw that SQL at your
Doctrine\DBAL\Connection instance... The Question asked about "DQL", which
is the ORM DSL for querying.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
Post by Nima Sadjadi
Hi,
Sorry I a, newbie and cannot help you. just noticed Marco understood you
wrongly,
Post by safraoui karim
Nima Sadjadi,
yes , i want to use dbal :)
Post by Nima Sadjadi
Marco, I think he wants to do it with dbal, not with orm as you said!
--
You received this message because you are subscribed to a topic in the
Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/doctrine-user/sYRtEFkVxQw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "doctrine-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/doctrine-user/sYRtEFkVxQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to doctrine-user-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Loading...