$result = RawQuery::table('character_tbl') ->select('character_tbl.character_id', 'name', 'COUNT(friend_id) AS friend_count') ->leftJoin('friend_tbl', 'USING', 'character_id') ->where('character_tbl.character_id', $character_id) ->group_by('character_id') ->get_one(); return self::inflate($result); } }