Hello, 

I'm trying to do this SQL request (postgresql) : 

select SUM (montant) AS solde FROM entrees WHERE account_id = 1 and 
date_de_valeur >= '2022-02-01' and date_de_valeur < '2022-03-01'

Reading the documentation on virtual rows, I do this in Sequel: 

DB[:entrees].select{[sum(montant).as(solde)]}.where{(date_de_valeur >= 
'2022-02-01') & (date_de_valeur <= '2022-03-01')}.where(account_id: 
1).map(:solde)

That last query return an erroneous result. What am I doing wrong? 

Thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/12aae7ee-7d70-49d6-b998-d2779bfccca6n%40googlegroups.com.

Reply via email to