Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

How to count distinct columns query? [closed]

$
0
0

I have to find the total number or records but count is based on distinct of multiple columns.

I have following lines in my query.

$query = $this->createQueryBuilder("j");
$query->select(
                "COUNT(DISTINCT 
                        'j.mark',
                        'j.model'
                    ) as total");

But this is giving me error:

[Syntax Error] line 0, col 76: Error: Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got ','

Can anybody please help me solve this issue?

Thank You.


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>