Hey guys, I probably know the answer, but can we w...
# orm-help
e
Hey guys, I probably know the answer, but can we write something like this with Prisma
Copy code
SELECT SUM(IF(COALESCE(nro_factura, -1) != -1, porc_hes, 0)) as sumaPctFacturado FROM ...
I currently have the following with TypeORM and it works fine
Copy code
select([
    'SUM(porc_hes) as sumaPctPagado',
    'SUM(IF(COALESCE(nro_factura, -1) != -1, porc_hes, 0)) as sumaPctFacturado'
])
r
@Eric Martinez 👋 You can use raw queries for this 🙂