Erlang Mnesia Equivalent of SQL Select FROM WHERE Field IN (value1, value2, value3, ...)

Posted by ErJab on Stack Overflow See other posts from Stack Overflow or by ErJab
Published on 2010-05-26T05:57:18Z Indexed on 2010/05/26 6:01 UTC
Read the original article Hit count: 308

Filed under:
|
|
|

I have an mnesia table with fields say f1, f2, f3. Now if I were to select all the rows with the field value as V1, I would use mnesia:select and match specifications or a simple mnesia:match_object. Now I need to select all the rows which have V1, V2, V3 ... or Vn (a list of arbitrary length) as the value for field f1. In SQL I would do something like

SELECT * FROM tablename WHERE f3 IN (V1, V2, V3, ... , Vn)

How do I do this in mnesia?

© Stack Overflow or respective owner

Related posts about database

Related posts about select