How to create Magento 2 custom collection query
To create Magento 2 custom collection query, use the same principle as in case of 1.x (Magento 2 SQL query syntax s the same). For instance:

Source (

To create Magento 2 custom collection query, use the same principle as in case of 1.x (Magento 2 SQL query syntax s the same). For instance:
Source (