Issue in Kohana Query <p>I'm facing an issue in my query.Kindly help me to sort the issue (I’m newbie in Kohana Framework)</p> <pre><code>$posts-&gt;select(array(DB::expr('( SELECT COUNT(id_visit) FROM `oc2_visits` WHERE `oc2_post`.`id_post` = `oc2_visits`.`id_ad` AND `oc2_visits`.controller = "Blog" GROUP BY `oc2_visits`.`id_ad`)'), 'hits')); //we sort all ads with few parameters $posts = $posts-&gt;order_by('created','desc') -&gt;limit($pagination-&gt;items_per_page) -&gt;offset($pagination-&gt;offset) -&gt;limit(Theme::get('num_home_blog_posts', 4))-&gt;cached() -&gt;find_all(); </code></pre> <p>As you can see 'hits' is property set at DB:expr(). In my view I'm trying to access the $posts->hits; property. Then the issue appearing hits property doesn't exists. <a href="https://i.stack.imgur.com/XSVTs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XSVTs.png" alt="enter image description here"></a></p> <p>Image is attached, Please help I'm not expert in kohana framework.</p>