adding a concatenated field in an SQL query breaks LIKE

Dr. Hawkins dochawk at gmail.com
Sun Jul 13 15:02:24 EDT 2014


On Sun, Jul 13, 2014 at 9:55 AM, Peter Haworth <pete at lcsql.com> wrote:

> Correction to my earlier post.  SQLite is case sensitive with simple
> comparisons like "=" but the LIKE operator is not case sensitive so there
> is something else going on.
>

OK, thought so.



> It's hard to discern the issue from your post because every SELECT
> statement in it is exactly the same except one has "alder" and the rest
> have "alde" and none except the first match the results you included.
>

"alde" and "alder" should both only match  the "Alderan" and give the
correct result.

The problem is the "ban" and "bank" which should match multiples


>
> I've used LIKE statements on concatenated columns in the past and never had
> a problem so I'll guess that there's some data problem with the column that
> you add to the concatenation when it fails.  What happens if you use that
> column instead one of the others, same result or different?
>
> If all else fails, you could use:
>
> (cname LIKE '%bank%' OR cadr LIKE '%bank' OR reason LIKE '%bank%')
>

That's my interim solution, in the other sub-thread  But it's a hack over
something that doesn't work like it should, which makes me nervice . . .
-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list