Hi there,
I have a set of data like this in a databoject called MyFruit
Name FruitPreference
Bob apple
Steve grape
Joe apple
James bannana
Sandra grape
Peter apple
I want to be able to query the dataobject and get a list of fruit from it. The kind of thing you would do with a SQL query using the groupby function. I know how to do it using the 'new SQLSelect' method, but i want to know how to use it with the easier syntax that we use in silverstripe....something like
$myresults = MyFruit::get()->distinct('FruitPreference')->sort('FruitPreference', 'ASC');