db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostyantyn Shchekotykhin <kos...@ifit.uni-klu.ac.at>
Subject Re: doSelectAllExcept... reference the same table twice
Date Mon, 03 May 2004 09:17:01 GMT
Hi Tarlika,
you should write direct strings if you want to use aliases. I mean, you should get the attribute
name from the Torque 
constant and concat alias name and attribute name.
String aliasName = "b1";
String b1brandName = aliasName + Brand.BRAND_NAME.substring(Brand.BRAND_NAME.indexOf("."));

Regards,
Kostya

T E Schmitz wrote:

> Hello,
> 
> I have a table which references the same table twice. In SQL, I would 
> express the SELECT (inner join) using an alias :
> 
> SELECT
> SECTION.SECTION_PK,
> SECTION.SECTION_NAME,
> SECTION.BRAND_1_FK,
> SECTION.BRAND_2_FK,
> b1.BRAND_PK,
> b1.BRAND_NAME,
> b2.BRAND_PK,
> b2.BRAND_NAME
> 
> FROM SECTION, BRAND  as b1,BRAND  as b2
> where b1.BRAND_PK = BRAND_1_FK and
> b2.BRAND_PK = BRAND_2_FK
> 
> Torque, however, will generate
> BRAND.BRAND_PK,
> BRAND.BRAND_NAME
> as the columns are static variables fully qualified by the tableir name.
> 
> Has anyone found a work-around?

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message