Welcome Guest, Not a member yet? Register   Sign In
Pagination with group by return oci_execute(): ORA-00979: not a GROUP BY expression
#1

(This post was last modified: 04-13-2024, 07:56 PM by just.)


        return $this;

Code:
$this->builder()
            ->select(‘name, address’)
            ->selectSum('TOTAL’)
            ->groupBy(‘name’, ‘address')
            ->limit($limit,  $offset);

        return $this;


Hi, im new to this forum, i tried to make pagination,  everything work without group by.  
can i get some help?

im using 4.4.6 version.
Reply
#2

Check the SQL statement, then you may know something.
https://codeigniter4.github.io/CodeIgnit...ql-queries
Reply
#3

Hi Kenjis, thanks for reply.
i tried to var dump. and show query looks fine.

event good without pagination from models. any specific Hints?
Reply
#4

If you get ORA-00979, the SQL statement is wrong.
So you need to fix the SQL statement.

> event good without pagination from models.

What do you mean?
Reply
#5

(This post was last modified: 04-13-2024, 08:52 PM by just.)

(04-12-2024, 06:09 PM)kenjis Wrote: Check the SQL statement, then you may know something.
https://codeigniter4.github.io/CodeIgnit...ql-queries

(04-13-2024, 08:11 PM)kenjis Wrote: If you get ORA-00979, the SQL statement is wrong.
So you need to fix the SQL statement.

> event good without pagination from models.

What do you mean?


i tried, without pagination, and its execute well. no error without ->paginate()
is there other ->groupBy() 
to grouping on builder?

(04-12-2024, 01:31 PM)just Wrote:
        return $this;

Code:
$this->builder()
            ->select(‘name, address’)
            ->selectSum('TOTAL’)
            ->groupBy(‘name’, ‘address')
            ->limit($limit,  $offset);

        return $this;


Hi Kenjis, thanks for pointing me out.
its done by change : 
 
Code:
->groupBy(‘name’, ‘address')

into 
 -
  ->groupBy(‘name,address')
Reply
#6

See https://codeigniter4.github.io/CodeIgnit...er-groupby
Reply




Theme © iAndrew 2016 - Forum software by © MyBB