在 NOT IN 语句中查询 Doctrine
Query inside NOT IN statement Doctrine
我在代码中找到了这句话:
$dql
= <<<DQL
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
AND
r.profile = :sales_profile
AND
r.company = :company
AND
u.onlyStatus NOT IN (:status)
DQL;
我不知道如何在 NOT IN
句子中进行查询,请帮助我。
我需要知道:
- 什么return里面的查询
NOT IN
,(数据类型等等...)
- 如何在
NOT IN
中进行查询(可行吗?)
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
这意味着在 'Goal' table.
当前没有 'objective' 的所有用户
这是您需要的吗?
我在代码中找到了这句话:
$dql
= <<<DQL
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
AND
r.profile = :sales_profile
AND
r.company = :company
AND
u.onlyStatus NOT IN (:status)
DQL;
我不知道如何在 NOT IN
句子中进行查询,请帮助我。
我需要知道:
- 什么return里面的查询
NOT IN
,(数据类型等等...) - 如何在
NOT IN
中进行查询(可行吗?)
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
这意味着在 'Goal' table.
当前没有 'objective' 的所有用户这是您需要的吗?