$q = $this->db->select(\' books.title, reserved_books.id, reserved_books.isbn, reserved_books.price,
You don't need any join
$query=$this->db->distinct()->select('table_attribute')->where('condition')->get('table_name'); return $query->result();