[erlang-questions] mnesia ordered_set tables, select previous N records starting from given key

John Doe donpedrothird@REDACTED
Tue Jun 21 10:11:35 CEST 2016


Hi all,
Is it possible to select previous N records from the ordered_set mnesia
table starting from given key? Something like this
mnesia:select(table, [{#table{key='$0', _='_'},[{'>', '$0', <<"key">>}
],['$_']}], 10, read)
but with DESC order of sorting? Without using just prev and next functions,
as guards can be more complex. Just changing '>' to '<' won't work as
records will be selected from the beginning of the table instead of from
the key.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160621/d6f185fd/attachment.htm>


More information about the erlang-questions mailing list