Subject | Re: equal not getting results |
---|---|
Author | Svein Erling |
Post date | 2003-11-06T12:49:57Z |
> I have many records in DatosUno with Contrato='60NSL305' (for5 RC6,
> example, the same happens with any value). If I issue
>
> select * from DatosUno where Contrato='60NSL305'
>
> then it returns several records, correctly.
>
> But now, I too have many records in DatosTerminales with
> Contrato='60NSL305', but if I ask for
>
> select * from DatosTerminales where Contrato='60NSL305'
>
> it returns nothing. But if I ask
>
> select * from DatosTerminales where Contrato like '60NSL305%'
>
> then it returns all rows with Contrato='60NSL305'.
>
> Any idea why is this happening? I have tried with FB 1.0.3 and FB 1.
> same result. I dropped the index IXCONTRATOCODIGO_TERM, sameresult...
> I need to get the records from an outer join on both tables, likethis
>DatosTerminales.
> select o.Contrato, o.FechaPedido, o.Caja, o.Codigo, o.Cantidad as
> CantPedida, o.Lote, t.Cantidad as CantRecibida, t.FechaRecepcion,
> t.NroTerminal, o.Grupo
> from DatosUno o
> left join DatosTerminales t on (o.Contrato=t.Contrato and
> o.Codigo=t.Codigo)
>
> but it gets all the data from DatosUno, nothing from
Try
SELECT DISTINCT '"' || Contrato || '"' FROM DatosTerminales
WHERE Contrato STARTING '60NSL305'
If the result is "60NSL305 " and not "60NSL305", your problems are due
to trailing spaces.
Set