[prev in list] [next in list] [prev in thread] [next in thread]
List: erlang-questions
Subject: [erlang-questions] newbie question
From: listproc () blanked ! org (Ukyo Virgden)
Date: 2007-11-28 22:04:48
Message-ID: D109D9DF-6B3F-4A64-8C1F-332811046426 () gencay ! net
[Download RAW message or body]
Hi,
I've just jumped into Erlang. Almost finished reading Joe Armstrong's
book. While testing with mnesia, I've come across a problem I hope
you guys can shed a light.
Consider I have records like (count, item, user)
{4, apple, john}
{7, apple, mary}
{3, oranges, jane}
{2, oranges, john}
{2, bananas, mary}
{5, bananas, jane}
{2, bananas, john}
I can store in mnesia and retrieve with qlc. But I could not "group"
them. I figured out how inappropriate it'd be to ask is qlc has a
facility like SQL GROUP BY. :)
Can anybody help me how can I group returned list? Or in other words,
how can I apply an aggregate function to get sum of items, count of
items etc.? I've already figured out I can send my process some
messages and collect data but I believe that'd be slower than being
able to write a recursive function.
I'd appreciate if you could provide some pointers to resources for
functional programming techniques in Erlang.
Thanks in advance
Ukyo Virgden
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic