magento 2: How to use the order by and limit clause in sql query

You can use setPageSize() to use limit in collection

$giftColletion = $this->_giftFactory->getCollection();
$giftColletion->addFieldToFilter('store_id', 1);
$giftColletion->setOrder('position','ASC');
$giftColletion->setOrder('salary','ASC');
$giftColletion->setPageSize(10);

Using Page size you can set limit:

$giftColletion = $this->_giftFactory->getCollection();
    $giftColletion->addFieldToFilter('store_id', 1);
    $giftColletion->setOrder('position','ASC');
    $giftColletion->setPageSize($pageSize);
    $giftColletion->setCurPage($page);

$giftColletion = $this->_giftFactory->getCollection()->addFieldToFilter('store_id', 1);
$giftColletion->setOrder('position', 'ASC');
$giftColletion->setOrder('attribute_code', 'ASC'); 
$giftColletion->setPageSize($limitNo);