[erlang-questions] ets:select_count & ets:fun2ms problems

wenew zhang <>
Wed Apr 23 12:03:21 CEST 2008


In the erl shell,i input as below
*********begin*******************
Tab=ets:new(client,[set,{keypos,1}]).
ets:insert(Tab,{1,1}).
ets:insert(Tab,{2,2}).
ets:insert(Tab,{5,5}).
ets:insert(Tab,{3,3}).
ets:insert(Tab,{4,4}).
 ets:fun2ms(fun({M,N}) when N>3 ->M,N end).
ets:select_count(Tab,[{{'$1','$2'},[{'>','$2',1}],['$1','$2']}]).
*********end*******************
the last line return 0,
i want get the count of the ets:Tab when column 2>1,
if i want get Max column2's record([5,5]),how to do ?

Best Regards

Wenew Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080423/8eeab41b/attachment.html>


More information about the erlang-questions mailing list