Zend certified PHP/Magento developer

Add limit on collection of custom table and get one column value in Magento 2

I know there are solutions for getting one column as an array.

$collection->getColumnValues(‘column_name’);

And adding limit without setPageSize() and setCurPage()

$collection->getSelect()->limit(3)

But I want both.

My temp solution is I’ll run foreach loop over the collection from limit statement and just fetch the column in the array as per the requirement.