07.
SELECCIONA la SUMA (o CUENTA)
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
2 Comments
Hi guys,
Does anybody knows how to write an
addSelect()withCOUNT(DISCINCT...)clause with a condition?Something like:
->addSelect('COUNT(DISTINCT customer.id) IF (... some condition ...) as customers')Thanks!
Hey @Sebastien-D ,
Actually, addSelect('COUNT(DISTINCT customer.id)') should work. Did you try it? Do you have any issues with executing that query? Probably error message should hint the problem. About adding the IF right inside the
addSelect()- not sure it will work, though I think you can easily move that condition out to thewhere(), no?Cheers!
"Houston: no signs of life"
Start the conversation!