在symfony中的querybuilder中使用查询和子查询

时间:2016-10-28 06:24:26

标签: php mysql symfony doctrine

我使用简单的代码mysql,我无法生成此代码到querybuilder 请帮帮我

SELECT *
FROM `sites` AS s
WHERE s.`quantity` > 0 AND s.`status` = 1 AND (SELECT count(`visitsite`.`id`)
                                               FROM `visitsite`
                                               WHERE `visitsite`.`site` = s.`id` AND
                                                     `visitsite`.`createdate` > '2016-10-25 00:00:00'
                                              ) < (SELECT `quantity`
                                                   FROM `limitviewday`
                                                   WHERE `limitviewday`.`id` = s.`limitviewday`)

0 个答案:

没有答案