Have you tried to enter the columns to join on explicitly?

Something like this

select ...
from storage.Storage as Storage
join language.Language AS Language
    on  Storage.SOMEID = Language.SOMEID
    and Storage.storageId = ...

Regards,
Sergii


On 16 Грд, 09:48, Göran <[email protected]> wrote:
> I have made a join between two tables. My problem is that In the two
> tables I have two columns with the same name (storage.description,
> language.description) and can´t find a way to alias one of the columns
> to another name. It is simple to do it in sql.
>
> I have this working:
>
> <cfset theQuery = getTransfer().createQuery("from storage.Storage AS
> Storage
>         JOIN language.Language AS Language
>                 where Storage.storageId = :storageId
>                 AND Language.language = :language")>
>         <cfset theQuery.setParam("storageId", arguments.storageId, "numeric")
>
>         <cfset theQuery.setParam("language", arguments.country, "string")>
>
>         <cfset storage = getTransfer().listByQuery( theQuery ) />
>
> but there will be errors if I try to put anything before from. I have
> also tried:
>
> <cfimport prefix="t" taglib="/transfer/tags">
>
> <t:query name="theQuery" transfer="#getTransfer()#">
>         select
> Storage.storageId,Storage.file,Storage.datcreated,Storage.userid,Storage.protect,Storage.clicks,Storage.views,Storage.amount,Storage.paysystem,Storage.paymethod,Storage.storagePic,Storage.linktext,Storage.description
> AS storageDescription
>         from storage.Storage AS Storage
>                 JOIN language.Language AS Language
>         where  Storage.storageId = <t:queryparam
> value="#arguments.storageId#" type="numeric">
>                 AND Language.language = <t:queryparam 
> value="#arguments.country#"
> type="string">
> </t:query>
>
> First I tried *, Storage.description AS storageDescription and got a
> cryptic error message about line 0 :1:2 etc..
>
> To put it simple is it possible to have something before FROM and what
> is the syntax?

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to