I have a query, that I want to make, it is an INSERT FROM a SELECT GROUP BY, but I get the error:

> 
> ERROR: INSERT has more target columns than expressions  
> 
>  LINE 15: INSERT INTO "KPI\_MEASURE" (id, created\_at, kpi\_project\_id, k...  
> 
>  \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_^  
> 
>  HINT: The insertion source is a row expression containing the same number of columns expected by the INSERT. Did you accidentally use extra parentheses?
> 
> 
> 

I've searched this error, but what I found is that, this error happen, if the number of rows doesn't match, but for the query below, there is the same number of row.  

Postgres SQL query:

```
INSERT INTO "KPI_MEASURE" (
        id,
        created_at,
        kpi_project_id,
        kpi_frequency_id,
        kpi_metric_id,
        branch,
        value
    )
SELECT (
        nextval('"KPI_MEASURE_ID_seq"'::regclass),
        now(),
        kpi_project.id,
        kpi_measure.kpi_frequency_id,
        kpi_metric.id ,
        kpi_measure.branch ,
        sum(kpi_measure.value)
    )
FROM "KPI_MEASURE" kpi_measure
    INNER JOIN "KPI_METRIC" kpi_metric                      ON kpi_measure.kpi_metric_id = kpi_metric.id
    INNER JOIN "KPI_PROJECT" kpi_project                    ON kpi_measure.kpi_project_id = kpi_project.id
    INNER JOIN "KPI_AGGREGATION_PROJECT" kpi_agg_project    ON kpi_project.name = kpi_agg_project.child_project_name
    WHERE kpi_metric.aggregated = false
GROUP BY kpi_measure.branch, kpi_metric.id, kpi_project.id, kpi_project.name, kpi_frequency_id;

```