> 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.? Check qlc:fold/3. Georgy