我的Symfony 4.4应用程序中的有一个问题。
我的查询中失败的特定部分是IS NOT TRUE部分。
我得到以下错误:
In QueryException.php line 32:
[Syntax Error] line 0, col 829: Error: Expected =, <, <=, <>, >, >=, !=, got 'IS' $qb = $this->_em->createQueryBuilder();
$qb->select(
$qb->expr()->count('s.id').' AS total_clubs',
"SUM(CASE WHEN s.currentTier = 'platinum' AND s.uefa IS NOT TRUE THEN 1 ELSE 0 END) AS platinum_clubs_non_uefa",
"SUM(CASE WHEN s.currentTier = 'platinum' AND s.uefa = TRUE THEN 1 ELSE 0 END) AS platinum_clubs_uefa",
"SUM(CASE WHEN s.currentTier = 'gold' THEN 1 ELSE 0 END) AS gold_clubs"
)我尝试过各种各样的<> TRUE、!= TRUE和= FALSE,但是我没有能够提取出我想要的数据。
当我手动查询PostgreSQL数据库时,可以使用的查询是:
...AND uefa IS NOT TRUE;
我如何调整这个查询,从这个布尔字段中提取不真实的值?
composer show | grep doctrine
doctrine/annotations 1.13.2 Docblock Annotations Parser
doctrine/cache 2.1.1 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers...
doctrine/collections 1.6.8 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common 3.3.0 PHP Doctrine Common project is a library that provides additional functionality that other Doctri...
doctrine/data-fixtures 1.5.3 Data Fixtures for all Doctrine Object Managers
doctrine/dbal 2.13.8 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspecti...
doctrine/deprecations v0.5.3 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable...
doctrine/doctrine-bundle 2.6.3 Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle 3.4.1 Symfony DoctrineFixturesBundle
doctrine/doctrine-migrations-bundle 3.0.3 Symfony DoctrineMigrationsBundle
doctrine/event-manager 1.1.1 The Doctrine Event Manager is a simple PHP event system that was built to be used with the variou...
doctrine/inflector 2.0.4 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to up...
doctrine/instantiator 1.4.1 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer 1.2.3 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations 3.4.2 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction...
doctrine/orm 2.12.1 Object-Relational-Mapper for PHP
doctrine/persistence 2.5.1 The Doctrine Persistence project is a set of shared interfaces and functionality that the differe...
doctrine/sql-formatter 1.1.2 a PHP SQL highlighting librarypg_config --version
PostgreSQL 12.9
psql --version
psql (PostgreSQL) 12.9发布于 2022-04-29 07:04:13
而不是IS NOT TRUE,你试过= FALSE吗
https://stackoverflow.com/questions/72053816
复制相似问题