Subject | Re: [firebird-support] Where condition by column number |
---|---|
Author | Ann Harrison |
Post date | 2012-12-01T19:14:50Z |
On Sat, Dec 1, 2012 at 8:09 AM, Leonardo M. Ramé <l.rame@...> wrote:
theory is the separation of the logical from the physical. Codd and all
his minions will strike you down.
On the other hand, why not just use consistent aliases?
select
case
when (a.IDADICIONAL is null) then 'TITULAR'
else 'ADICIONAL'
end as col1,
c.idcliente as col2, c.apellido as col3, c.nombres as col4
from clientes c
left join adicionales a on a.IDADICIONAL = c.IDCLIENTE
> Hi, I'm wondering if there's a way to refer columns by number in WHEREWhat you suggest, sir, is blasphemy. One of the major creeds of relational
> conditions.
>
> I need this because I'm creating a generic method to create where
> clauses for hopefully ANY query, in FreePascal
theory is the separation of the logical from the physical. Codd and all
his minions will strike you down.
On the other hand, why not just use consistent aliases?
select
case
when (a.IDADICIONAL is null) then 'TITULAR'
else 'ADICIONAL'
end as col1,
c.idcliente as col2, c.apellido as col3, c.nombres as col4
from clientes c
left join adicionales a on a.IDADICIONAL = c.IDCLIENTE
>[Non-text portions of this message have been removed]
>