So basically I want to retrieve a results in the sales_order and display it in Admin Grid.But what I want is to retrieve the result using Group By. That way I have a unique list of Customer_email. How can I do this in Magento 2?
So basically I added these files
So basically what I want is when I generate the result in my admin page the result should display all the list of
customer_name etc... and these result is grouped by
customer_email. So I'm just wondering how can I customize the retrieval of collection in the Admin Grid? Like I would assume retrieval of the record is something like
select * from sales_order limit 20 or something. Now I want to override the default behaviour of the retrieval of collection and make it something like
select customer_email from sales_order group by customer_email
How do I achieve this? I read someone mentioned about adding it to _prepareCollection or something but where will I put this?