You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A derived table must have unique column names, even if you don't reference them outside that derived table. In your case, an alternative alias for either http://B.ID or http://A.ID is required. I'm not really sure this should be treated as a bug.
Submitted by: Pieter Libin (pieter_emweb.be)
Consider we have a new database containing the following tables:
create table "table_b" (
"id" bigint primary key,
"name" varchar(50) not null
);
create table "table_a" (
"id" bigint primary key,
"date" date,
"b_id" bigint,
constraint "fk_table_a_b" foreign key ("b_id") references "table_b" ("id") on update cascade on delete cascade
);
When we try to execute a count query, which appears to me to be valid SQL:
select count(1) from ( select B."id", B."name", A."id", A."date", A."b_id" from "table_b" B join "table_a" A on A."b_id" = B."id");
an error is reported
column id was specified multiple times for derived table <unnamed>
The text was updated successfully, but these errors were encountered: