how to use DISTINCT here in my query CODEIGNITER

前端 未结 5 1148
野趣味
野趣味 2020-12-20 13:40
$q = $this->db->select(\'
             books.title,
             reserved_books.id,
             reserved_books.isbn, 
             reserved_books.price,
              


        
5条回答
  •  失恋的感觉
    2020-12-20 14:31

    Try Below:

    $this->db->distinct();
    

    but Distinct will not always work. You should add ->group_by("name_of_the_column_which_needs_to_be unique");

    $this->db->group_by('column_name');
    

提交回复
热议问题