libpq++: how do I qualify by table name a resulting field when there are duplicate field names

From: "Nicolae" <nick(at)strongholdtech(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq++: how do I qualify by table name a resulting field when there are duplicate field names
Date: 2001-03-21 15:59:41
Message-ID: 99aiol$251g$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I'm having a little problem with libpq++. Works great for everything else
I'm doing.

Table CUSTOMERS and TABLE deals are joined by CUSTOMERS.NUMBER =
DEALS.CUSTOMERNUMBER

Both tables have a NUMBER field (in the CUSTOMERS table this represents the
customer number, in the DEALS table this represents the deal number - they
are not joined).

SELECT * FROM customers, deals WHERE customers.number = deals.customernumber
AND customers.number = 1;

When I do

database->GetValue (0, "number");

I get back the number field of the customer table.

But I want the number field from the deal table too.
How do I get it?

database->GetValue (0, "deals.number")

gives me an error.

Thanks for your help.
If possible please cc: me via email (nick(at)strongholdtech(dot)com)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michelle Murrain 2001-03-21 16:08:08 Cold Fusion/ODBC
Previous Message Hans-Jürgen Schönig 2001-03-21 15:31:49 Re: Compile PL/Perl