select
count("id") as "count",
(select
CONCAT('S_' ,
CONCAT(
CONCAT(
CONCAT(
CONCAT(
(select
"__nc_formula0"."Name"
from "phfkuelil8tvz45"."Project" as "__nc_formula0"
where "__nc_formula0"."id" = "__nc_gb0"."Project_id"
)
,'_'
) as cz1l4zf8id7m6ky,"__nc_gb0"."Name"
) as cz1l4zf8id7m6ky,'_'
) as cz1l4zf8id7m6ky,"__nc_gb0"."id"
) as cz1l4zf8id7m6ky
) as cz1l4zf8id7m6ky
from "phfkuelil8tvz45"."Series" as "__nc_gb0"
where "__nc_gb0"."id" = "phfkuelil8tvz45"."Sample"."Series_id"
) as "c19jwv38z0ekwnh"
from "phfkuelil8tvz45"."Sample"
group by "c19jwv38z0ekwnh"
order by "c19jwv38z0ekwnh" asc nulls FIRST limit 25
in order to make it work, all as cz1l4zf8id7m6ky, but the last one, should be removed.
6cd2b5c196e6 2025-03-21T14:13:35.432073334+01:00 2025-03-21 13:13:35.432 UTC [862] ERROR: syntax error at or near "as" at character 224
6cd2b5c196e6 2025-03-21T14:13:35.432073334+01:00 2025-03-21 13:13:35.432 UTC [862] STATEMENT: select count("id") as "count", (select CONCAT('S_' ,CONCAT(CONCAT(CONCAT(CONCAT((select "__nc_formula0"."Name"
from "p13xr3lsk40q0d5"."Project" as "__nc_formula0" where "__nc_formula0"."id" = "__nc_gb0"."Project_id"),'_' ) as cz8ulnihh3xs0ol,"__nc_gb0"."Name") as cz8ulnihh3xs0ol,'_' ) as cz8ulnihh3xs0ol,"__nc_gb0"
."id" ) as cz8ulnihh3xs0ol) as cz8ulnihh3xs0ol from "p13xr3lsk40q0d5"."Series" as "__nc_gb0" where "__nc_gb0"."id" = "p13xr3lsk40q0d5"."Sample"."Series_id") as "c2jgh30z46g9pyr" from "p13xr3lsk40q0d5"."Sam
ple" group by "c2jgh30z46g9pyr" order by "c2jgh30z46g9pyr" asc nulls FIRST limit 25
i see the problem, while replicating the error for you to see it, i created this base:
In the table Samples, you can see two views âbySeriesâ and âbySeries2â respectively grouped by the linked tables âSeriesâ and âSeries copyâ.
âbySeries2â works fine, the âdisplay valueâ field being a formaly using function âconcatâ.
âbySeriesâ fails, the display value being a formula using logic operators, which confuses the SQL query generator for âgroup byâ.