Thank you for your answer. Indeed is my mistake for
doubling the backslash. The query submitted by you did
not work on my side. Normally it should work, the
similar query in mysql works without any problem, but
it seems that sqlite does not interpret it well...
Florin.
--- [EMAIL PROTECTED] wrote:
> Florin Serbanescu <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I have a string that contains a full path of a
> file
> > for example. Also I have a table in Sqlite that
> > contains a column name 'command' that has only the
> > filename. My question is how I can create a query
> so I
> > can retrieve all rows where command field is a
> > substring of my string. In MySQL for example I can
> do
> > this:
> >
> > SELECT * FROM mytable where 'c:\\Program
> Files\\a.exe'
> > like concat('%',command,'%').
> >
> > But it seems that in Sqlite does not work. Would
> be
> > something like:
> >
> > SELECT * FROM mytable where 'c:\\Program
> Files\\a.exe'
> > like '%'||command||'%'.
> >
>
> SELECT * FROM mytable
> WHERE 'c:\Program Files\a.exe' LIKE
> '%'||command||'%';
>
> Note that backslash "\" should not be escaped in
> standard
> SQL string literals. The need to double the \
> characters
> is a quirk of MySQL.
>
> --
> D. Richard Hipp <[EMAIL PROTECTED]>
>
>
>
-----------------------------------------------------------------------------
> To unsubscribe, send email to
> [EMAIL PROTECTED]
>
-----------------------------------------------------------------------------
>
>
____________________________________________________________________________________
Sponsored Link
Online degrees - find the right program to advance your career.
Www.nextag.com
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------