Thanks, for your help On Monday 18 December 2023 at 16:17:07 UTC+1 Jeremy Evans wrote:
> On Mon, Dec 18, 2023 at 5:43 AM Stéphane D'Alu <stepha...@gmail.com> > wrote: > >> Hi >> >> I'm trying to write something like: >> >> SELECT UNIX_TIMESTAMP(`time`) DIV 3600 * 3600 >> >> So far I managed to write: >> >> SELECT UNIX_TIMESTAMP(`time`) / 3600 * 3600 >> >> using >> >> DB.select(Sequel.function(:UNIX_TIMESTAMP, :time) / 3600 * 3600).sql >> >> But I fail to see how to replace / with DIV >> >> Any idea? Thanks >> > > Sequel doesn't support that natively, so something like: > > DB.select(Sequel.lit('? DIV ?', Sequel.function(:UNIX_TIMESTAMP, :time), > 3600*3600)) > > Thanks, > Jeremy > -- 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/efa80424-2afa-44c9-8ae9-f516dfb598cfn%40googlegroups.com.