On Mon, Dec 18, 2023 at 5:43 AM Stéphane D'Alu <[email protected]>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/CADGZSSdAp%2B7%3Dy1qmK84XP2ntu51c1aqCVx0z2%2BYgNTJgjUfD1g%40mail.gmail.com.