Shouldn't you use the Boolean test operator for equality ? That is: task(User) -> Q = query [ T || T <- table(tasks), U <- table(users), U.id == User, T.user_id == U.id ] end, F = fun() -> mnemosyne:eval(Q) end, mnesia:transaction(F). /Tobbe