[erlang-questions] Question: Limiting size of result set in mnesia
Ahmed Ali
ahmed.nawras@REDACTED
Mon Apr 28 14:42:37 CEST 2008
Thanks Hynek and Kenneth for the quick response.
Just to confirm, for qlc, I should write the query first and then run
qlc:info/2 on it in order to do the limiting, as the example below
shows. Is this it?
e.g.:
Q = qlc:q(...),
qlc:info(Q, [{n_elements, 5}]
Best regards,
Ahmed Al-Issaei
On Mon, Apr 28, 2008 at 4:32 PM, Kenneth Lundin
<kenneth.lundin@REDACTED> wrote:
> Hi,
>
> You can use qlc
> http://www.erlang.org/doc/man/qlc.html
> or you can use
> mnesia:select/4 in combination with mnesia:select/1
> http://www.erlang.org/doc/man/mnesia.html#select-4
>
> /Kenneth Erlang/OTP, Ericsson
>
>
>
>
> On 4/28/08, Ahmed Ali <ahmed.nawras@REDACTED> wrote:
> > Hi All,
> >
> > Does anyone have an idea of how to limit size of result set in mnesia
> > similar to the effect of LIMIT clause in the SQL query below in MySQL?
> >
> > SELECT * FROM Topic LIMIT 5;
> >
> > Best regards,
> >
> > Ahmed Al-Issaei
>
>
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
>
More information about the erlang-questions
mailing list