Select stu for every possible crop group.

If a crop_group is not present at the selected stu, take the next stu with max share for this crop group.
Removed unnecessary MAX calculation.
Bugfix, missing comma.
Merge pull request #1 from rchr/core_queries

Core queries