how to lookup last record in dataset in Mnesia?
Wed Jun 7 13:55:23 CEST 2006
I have a table in Mnesia, which I with to filter by some field(s) and
fetch one record with maximal ID (ie. last inserted).
The only method I can imagine -
make qlc query, sort it by ID in reverse order, create qlc cursor and
fetch exactly 1 record from resulting dataset.
(SQL equivalent: SELECT MAX(ID) FROM table WHERE foo_field = 'bar' and
user_name = 'Alice')
Are there any fast ways to achieve this in mnesia?
Thanks in advance, Gaspar
Network security consulting
t +37493 419763 (mob)
More information about the erlang-questions