how to create a query function to out-of-box list(custom list), like below:
Hi Andrea,
You can count the number of list items in a column via Modify this view -> Total section in an OOB way,
http://sharepointlogics.com/2010/03/total-count-of-items-in-list-in.html
http://office.microsoft.com/en-us/windows-sharepoint-services-help/create-or-change-a-view-HA010021577.aspx#BM3
Thanks
Daniel Yang
TechNet Community Support