Subject | Re: [firebird-support] Left join with containing condition |
---|---|
Author | Kjell Rilbe |
Post date | 2011-06-10T21:36:12Z |
Den 2011-06-10 23:02 skrev Kjell Rilbe såhär:
will result in something like '30017003<lotsofspaces>.'.
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> Den 2011-06-10 22:18 skrev Roland Turcan såhär:To clarify, since spaces got stripped, I meant that zzz_ukony.cs || '.'
> > Hi all,
> >
> > I have two tables which I need to join them over containing condition.
> >
> > This command doesn't join the tables using that condition:
> >
> > select a.*, b.*
> > from zzz_ukony a
> > left join zzz_doc b on b.filename containing a.cs||'.';
> >
> > but for test these commands work fine and return what I am looking for:
> >
> > select * from zzz_doc where filename containing '30017003.';
> > select * from zzz_ukony where cs containing '30017003';
> >
> > What could be a problem?
> >
> > Firebird 2.1.4 Windows
>
> Just a suspicion: is a.cs char or varchar?
>
> If it's char, then zzz_ukony.cs || '.' will result in e.g.
> '30017003 .', which probably cannot be found in any zzz_doc.filename
> values.
will result in something like '30017003<lotsofspaces>.'.
> If this is the case, perhaps cast to varchar and right-trim beforeKjell
> concatenation.
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64