SCM

[#1011090] Can't access to two same named fields in a join query.

View Trackers | Bugs | Download .csv | Monitor

Date:
2011-09-10 16:24
Priority:
3
State:
Open
Submitted by:
Armin Telker (armintelker)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.9
Category:
Group:
Resolution:
None
Summary:
Can't access to two same named fields in a join query.

Detailed description
I have a query:

SELECT
"products"."id", "products"."productkey", "products"."name", "products"."categoryid", "products"."parentproductid", "products"."price", "products"."productdate",
"clients"."id", "clients"."phone", "clients"."firstname",
"clients"."lastname", "clients"."company", "clients"."email",
"clients"."city", "clients"."zipcode", "clients"."street", "clients"."streetnumber",
"clients"."description", "clients"."lat", "clients"."lng", "clients"."name"
FROM "products"
INNER JOIN "clients" ON "clients"."id" = "products"."id" WHERE "products"."id" != 1;

(The query isn't a realistic join. It is a test join without sense.)

I select
"products"."name" and "clients"."name"

I can't find out which "name" i currently have selected. "products"."name" or "clients"."name" .

Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(query, con);
Npgsql.NpgsqlDataReader reader = command.ExecuteReader();

while (reader.Read()) {
Console.WriteLine(reader["name"]); // i can select "products"."name" or "clients"."name".
}

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge