Quick SQL question

john at splash21.com john at splash21.com
Mon Jul 15 09:59:20 EDT 2013


Googling it suggests that '||' is concatenate in SQLite, so try;

WHERE (name || tags || comment) LIKE '%.....




Quoting Klaus major-k <klaus at major-k.de>:

> Hi Pete,
>
> Am 15.07.2013 um 15:25 schrieb john at splash21.com:
>
>> Most engines have a concatenate command, something like;
>> WHERE CONCAT(name, tags, comment) LIKE '%tUserInput%'
>
> Aha, cool! Thanks!
> Do you know if this supported by SQLite?
>
>> :)
>>
>> Quoting Klaus major-k <klaus at major-k.de>:
>>
>>> Hi firends,
>>>
>>> with a table consisting of 3 (or more) db fields:
>>> name
>>> tags
>>> comment
>>>
>>> If I want to find a value in ALL of the three (or more) db fields,  
>>> I now use:
>>> ...
>>> ## Pseudocode, quotes etc missing, I know!
>>> put fld "searchfield" into tUserInput
>>> select * from myTable where name LIKE %tUserInput% OR tags LIKE  
>>> %tUserInput% OR comments  LIKE %tUserInput%
>>> ...
>>> You get the picture :-)
>>>
>>> Now my question: Is there a shorter SQL command for my purpose,  
>>> that I did not find yet?
>>> Thanks in advance!
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> klaus at major-k.de
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>






More information about the use-livecode mailing list