$q = $this->db->select(' books.title,reserved_books.id,reserved_books.isbn,reserved_books.price,reserved_books.item_sold,reserved_books.date_sold,reserved_books.total_amount ') ->from('reserved_books') ->join('books','reserved_books.isbn= books.isbn') ->limit($limit,$offset);
我怎么能在我的查询中使用distinct?
reserved_books.isbn是唯一的.
试试下面:
原文链接:https://www.f2er.com/php/135993.html$this->db->distinct();
但是,区别并不总是有效.你应该添加 – > group_by(“name_of_the_column_which_needs_to_be unique”);
$this->db->group_by('column_name');