On 7 Jul 2018, at 12:04pm, Cecil Westerhof <[email protected]> wrote:
> I went for the following solution:
> UPDATE selectRandom
> SET lastUsed = DATE('now', 'localtime')
> , lastUsedIdx = (
> SELECT IFNULL(MAX(lastUsedIdx), 0)
> FROM selectRandom
> WHERE lastUsed = DATE('now', 'localtime')
> ) + 1
> WHERE description = :teaToBrew
>
> I would think that is not to convoluted.
Elegant. I understood it. Though I was primed with what you're trying to do.
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users