Re: [sqlite] NOT LIKE statement

2008-06-25 Thread Simon Davies
is it possible to get the expected result? > Thank you. > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Simon Davies > Sent: Wednesday, June 25, 2008 3:57 PM > To: General Discussion of SQLite Database > Subject: Re: [

Re: [sqlite] NOT LIKE statement

2008-06-25 Thread James
: [sqlite] NOT LIKE statement Hi James, I think the problem lies with your expectations. Read the section on the LIKE operator in http://www.sqlite.org/lang_expr.html Rgds, Simon 2008/6/25 James <[EMAIL PROTECTED]>: > Hi, > > I execute the SQL statement [SELECT Name FROM

Re: [sqlite] NOT LIKE statement

2008-06-25 Thread Simon Davies
Hi James, I think the problem lies with your expectations. Read the section on the LIKE operator in http://www.sqlite.org/lang_expr.html Rgds, Simon 2008/6/25 James <[EMAIL PROTECTED]>: > Hi, > > I execute the SQL statement [SELECT Name FROM tr069;] and get the result > >

[sqlite] NOT LIKE statement

2008-06-25 Thread James
Hi, I execute the SQL statement [SELECT Name FROM tr069;] and get the result InternetGatewayDevice.DeviceInfo. InternetGatewayDevice.DeviceInfo.AdditionHardwareVersion InternetGatewayDevice.DeviceInfo.AdditionalSoftwareVersion InternetGatewayDevice.DeviceInfo.Description

Re: [sqlite] SQLITE QUERY (LIKE)

2008-03-31 Thread BareFeet
Hi Monica, > WHERE table.code like table2.code+'%' > > really i dont know if i am doing something wrong for sqlite, because > in access my query works very good. Replace the + with || which is used to concatenate strings. In fact, I think || is the SQL standard. See:

[sqlite] SQLITE QUERY (LIKE)

2008-03-31 Thread Monica Morales
Hi, how are you?? actually i'm developing a program in SQLite, and until this moment i wouldn't have any problem, but now i have a big one with a huge difficult in a query. this query is: SELECT table.code, table.name FROM table, table table2 WHERE table.code like table2.code+'%' really i

Re: [sqlite] SQLite Like Query Optimization

2008-02-19 Thread Kalyani Phadke
fts3] So how can I use newly created Sqlite3.dll from command prompt to load fts. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, February 18, 2008 2:22 PM To: General Discussion of SQLite Database Subject: Re: [s

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread drh
"Kalyani Phadke" <[EMAIL PROTECTED]> wrote: > I have not recompiled sqlite 3 before. I am having trouble to find > documentation. > > Could anyone pls tell me how can I compile SQLite3 source code on > windows xp machine. Do I need to download FTS3 files ? Where can I find > those files? How can

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread P Kishor
Thanks > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor > Sent: Monday, February 18, 2008 11:10 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SQLite Like Query Optimization > > On 2/18/08

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread Kalyani Phadke
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor Sent: Monday, February 18, 2008 11:10 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite Like Query Optimization On 2/18/08, Kalyani Phadke <[EMAIL PROTECTED]> wrote: > I

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread P Kishor
; From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor > Sent: Monday, February 18, 2008 9:50 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SQLite Like Query Optimization > > On 2/18/08, Kalyani Phadke <[EMAIL PROTECTED]> wrote:

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread P Kishor
TECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of BareFeet > Sent: Friday, February 15, 2008 4:38 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SQLite Like Query Optimization > > Hi Kalyani, > > > select ID from TableA where column2 like '%test%' or

Re: [sqlite] SQLite Like Query Optimization

2008-02-18 Thread Kalyani Phadke
.. -Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BareFeet Sent: Friday, February 15, 2008 4:38 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite Like Query Optimization Hi Kalyani, > select ID from TableA where column2 l

Re: [sqlite] SQLite Like Query Optimization

2008-02-16 Thread drh
"Evans, Mark (Tandem)" <[EMAIL PROTECTED]> wrote: > snip... > > > > > LIKE operators cannot use indices unless the index is case > > insensitive. Use GLOB for case sensitive fields. > > > > Richard - i'm not sure i understand "unless the index is case insensitive." > How does that relate

Re: [sqlite] SQLite Like Query Optimization

2008-02-16 Thread Evans, Mark (Tandem)
...snip... > > LIKE operators cannot use indices unless the index is case > insensitive. Use GLOB for case sensitive fields. > Richard - i'm not sure i understand "unless the index is case insensitive." How does that relate to: sqlite> create table t (a varchar(10) primary key, b, c); sqlite>

Re: [sqlite] SQLite Like Query Optimization

2008-02-15 Thread BareFeet
Hi Kalyani, > select ID from TableA where column2 like '%test%' or column4like > '%test%' or column5 like '%test%' or column6 like '%test%' or column7 > like '%test%' or column8 like '%test%' order by column3 desc; As already stated, the like operator can't use indexes if you use "or", or

Re: [sqlite] SQLite Like Query Optimization

2008-02-15 Thread drh
"Kalyani Phadke" <[EMAIL PROTECTED]> wrote: > I am using Sqlite 3 as my database. One of my table contains 1280010 > rows. Db file size is 562,478KB. I am running DB on Windows XP pro-P4 > CPU 3.20GHz 3.19Hz ,2.00GB of RAM ) > > CREATE TABLE TableA > ( > ID INTEGER NOT NULL PRIMARY KEY

Re: [sqlite] SQLite Like Query Optimization

2008-02-15 Thread Ken
I'm not 100% sure but Try splitting your query out into 6 different selects, I think the OR clause is the problem... select ID from TableA where column2 like '%test%' union select ID from TableA where column4 like '%test%' HTH Kalyani Phadke <[EMAIL PROTECTED]> wrote: I am using

[sqlite] SQLite Like Query Optimization

2008-02-15 Thread Kalyani Phadke
I am using Sqlite 3 as my database. One of my table contains 1280010 rows. Db file size is 562,478KB. I am running DB on Windows XP pro-P4 CPU 3.20GHz 3.19Hz ,2.00GB of RAM ) CREATE TABLE TableA ( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, column1 VARCHAR (50) NOT NULL,

RE: [sqlite] Using LIKE to check the first digits?

2008-02-01 Thread Griggs, Donald
Regarding: >>Indices won't help with LIKE unless the column as a NOCASE collation. Use GLOB instead: >> ... WHERE number GLOB '1234*'; >>Note that "*" is the wildcard character with GLOB, not "%" >>as in LIKE. The above will use an index on the number column if it is available.

RE: [sqlite] Using LIKE to check the first digits?

2008-02-01 Thread Samuel R. Neff
to join our team building Flex based products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: P Kishor [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 9:28 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Using

Re: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread P Kishor
On 1/31/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Gilles <[EMAIL PROTECTED]> wrote: > > At 15:40 31/01/2008 -0800, James Dennett wrote: > > > > WHERE col LIKE '123%' or WHERE substr(col,1, 3) = '123' > > > > > >The optimizer has a decent chance of using an index for LIKE '123%' but > >

Re: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread Gilles
At 02:01 01/02/2008 +, [EMAIL PROTECTED] wrote: Indices won't help with LIKE unless the column as a NOCASE collation. Use GLOB instead: ... WHERE number GLOB '1234*'; Thank you for the tip. - To unsubscribe,

Re: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread drh
Gilles <[EMAIL PROTECTED]> wrote: > At 15:40 31/01/2008 -0800, James Dennett wrote: > > > WHERE col LIKE '123%' or WHERE substr(col,1, 3) = '123' > > > >The optimizer has a decent chance of using an index for LIKE '123%' but > >I'd be surprised (and impressed) if it looks inside function calls

RE: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread Gilles
At 15:40 31/01/2008 -0800, James Dennett wrote: > WHERE col LIKE '123%' or WHERE substr(col,1, 3) = '123' The optimizer has a decent chance of using an index for LIKE '123%' but I'd be surprised (and impressed) if it looks inside function calls suchas substr for opportunities to use indexes.

Re: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread Scott Baker
Gilles wrote: Hello I'm no SQL guru, and need to look up phone numbers in a SQLite database that start with certain digits. Some customers use http://en.wikipedia.org/wiki/Direct_Inward_Dialing, which means that the first part is common to all the numbers assigned to this customer, so I

RE: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread James Dennett
> -Original Message- > From: P Kishor [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 31, 2008 3:35 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Using LIKE to check the first digits? > > On 1/31/08, Gilles <[EMAIL PROTECTED]> wrote: > &

Re: [sqlite] Using LIKE to check the first digits?

2008-01-31 Thread P Kishor
On 1/31/08, Gilles <[EMAIL PROTECTED]> wrote: > Hello > > I'm no SQL guru, and need to look up phone numbers in a SQLite database > that start with certain digits. Some customers use > http://en.wikipedia.org/wiki/Direct_Inward_Dialing, which means that the > first part is common to all the

[sqlite] Using LIKE to check the first digits?

2008-01-31 Thread Gilles
Hello I'm no SQL guru, and need to look up phone numbers in a SQLite database that start with certain digits. Some customers use http://en.wikipedia.org/wiki/Direct_Inward_Dialing, which means that the first part is common to all the numbers assigned to this customer, so I don't need to

Re: [sqlite] Re: like operator

2007-08-26 Thread RaghavendraK 70574
; Date: Friday, August 17, 2007 7:25 am Subject: [sqlite] Re: like operator > RaghavendraK 70574 > <[EMAIL PROTECTED]> wrote: > > we have given a web interface which receive delete request. > > Now in the req we get "%" and in the delete impl we do this >

Re: [sqlite] Re: like operator

2007-08-16 Thread RaghavendraK 70574
l in error, please notify the sender by phone or email immediately and delete it! * - Original Message - From: Igor Tandetnik <[EMAIL PROTECTED]> Date: Friday, August 17, 2007 9:55 am Subject: [

[sqlite] Re: like operator

2007-08-16 Thread Igor Tandetnik
RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: we have given a web interface which receive delete request. Now in the req we get "%" and in the delete impl we do this delete from table where itemName like xxx.%; since the key is % the above statement becomes, "delete from table where itemName

Re: [sqlite] Override LIKE

2007-05-16 Thread drh
"Jonas Sandman" <[EMAIL PROTECTED]> wrote: > > I want LIKE to work just as well for non-ANSI characters, I think the > solution is to override LIKE with sqlite3_create_function but is there any > examples on how to use this function? > The built-in LIKE operator is created using the

Re: [sqlite] Override LIKE

2007-05-16 Thread Martin Jenkins
Jonas Sandman wrote: > I am using LIKE to make a simple query for filename '%path%' and it > works well as long as I am only using ANSI characters, LIKE thinks > 'a' and 'A' are the same. When coming up on Greek characters (i.e.) > it doesn't work that well anymore. Suddenly LIKE is

[sqlite] Override LIKE

2007-05-16 Thread Jonas Sandman
Hello, I am using LIKE to make a simple query for filename '%path%' and it works well as long as I am only using ANSI characters, LIKE thinks 'a' and 'A' are the same. When coming up on Greek characters (i.e.) it doesn't work that well anymore. Suddenly LIKE is case-sensitive (since LIKE use

Re: [sqlite] unicode like UPPER and LOWER ?

2007-05-08 Thread Dan Kennedy
On Tue, 2007-05-08 at 10:45 +0700, Kirill wrote: > Good day, > > SQLite version 3.3.17 > Enter ".help" for instructions > sqlite> create table tbl1(t1 varchar(10)); > sqlite> insert into tbl1 values('софт'); - lowChar > sqlite> insert into tbl1 values('СОФТ'); - upChar > sqlite> select * from

[sqlite] unicode like UPPER and LOWER ?

2007-05-07 Thread Kirill
Good day, SQLite version 3.3.17 Enter ".help" for instructions sqlite> create table tbl1(t1 varchar(10)); sqlite> insert into tbl1 values('софт'); - lowChar sqlite> insert into tbl1 values('СОФТ'); - upChar sqlite> select * from tbl1; софт СОФТ sqlite> select * from tbl1 where t1 like '%оф%'; -

[sqlite] Indexing LIKE. Was: case insensitivity

2006-11-28 Thread drh
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > Dixon Hutchinson > wrote: > > Sorry, meant to include a reference to 'p' in my select: > > SELECT * FROM foo WHERE bar LIKE 'something' AND p='some_int'; > > An expression involving LIKE cannot use an index anyway. This is mostly true, but there

Re: [sqlite] Seems like a bug in the parser

2006-08-25 Thread Alexei Alexandrov
On 8/23/06, Andrew McCollum <[EMAIL PROTECTED]> wrote: I find this feature useful, especially in queries which use aggregate functions, such as the following: SELECT sum(a) FROM tbl GROUP BY b The question should be what the compelling reason is to remove a useful feature. Of course it's OK

Re: [sqlite] Seems like a bug in the parser

2006-08-24 Thread Jay Sprenkle
> The question should be what the compelling reason is to remove a useful > feature. ... And *that* is exactly why Windows will always be full of security holes. I thought it was because it used the network for inter process communications (thus allowing external processes to attack it) --

Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Joe Wilson
--- Kurt Welgehausen <[EMAIL PROTECTED]> wrote: > > select a from qqq group by b; > > This question was discussed on the list a year or 2 ago. > > The column a in the simple query above is meaningless; it's > an arbitrary value from each group. There are queries, > however, where a non-grouped

Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Jonathan Ellis
On 8/23/06, Andrew McCollum <[EMAIL PROTECTED]> wrote: I find this feature useful, especially in queries which use aggregate functions, such as the following: SELECT sum(a) FROM tbl GROUP BY b The question should be what the compelling reason is to remove a useful feature. ... And *that* is

RE: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Andrew McCollum
[mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 7:02 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Seems like a bug in the parser > select a from qqq group by b; This question was discussed on the list a year or 2 ago. The column a in the simple query above is meaningl

Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Kurt Welgehausen
> select a from qqq group by b; This question was discussed on the list a year or 2 ago. The column a in the simple query above is meaningless; it's an arbitrary value from each group. There are queries, however, where a non-grouped column is meaningful, such as a join where the grouping column

Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Mario Frasca
Joe Wilson wrote: --- [EMAIL PROTECTED] wrote: SQLite accepts the above and does the right thing with it. It is the equivalent of saying: SELECT a FROM (SELECT a,b FROM qqq GROUP BY b); Not sure what you mean by the "right thing". It's not obvious why the rows returned by this GROUP BY

Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Alexei Alexandrov
On 8/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: SQLite accepts the above and does the right thing with it. It is the equivalent of saying: SELECT a FROM (SELECT a,b FROM qqq GROUP BY b); The subquery here doesn't make any sense to me. How a single 'a' is chosen for the grouped

Re: [sqlite] Seems like a bug in the parser

2006-08-22 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > "Alexei Alexandrov" <[EMAIL PROTECTED]> wrote: > > I noticed something like a bug in the SQLite parser: queries with > > "group by" expression should accept only fields listed in the "group > > by" clause or aggregated fields (with sum(), max() etc). For example, > >

Re: [sqlite] Seems like a bug in the parser

2006-08-22 Thread drh
"Alexei Alexandrov" <[EMAIL PROTECTED]> wrote: > I noticed something like a bug in the SQLite parser: queries with > "group by" expression should accept only fields listed in the "group > by" clause or aggregated fields (with sum(), max() etc). For example, > given the table > > create table qqq

[sqlite] Seems like a bug in the parser

2006-08-22 Thread Alexei Alexandrov
I noticed something like a bug in the SQLite parser: queries with "group by" expression should accept only fields listed in the "group by" clause or aggregated fields (with sum(), max() etc). For example, given the table create table qqq (a text, b integer); the following query should not be

Re: [sqlite] SQL Like expr not case sensitive Bug

2006-07-14 Thread drh
Pasquale Imbemba <[EMAIL PROTECTED]> wrote: > Hi, > > is there any news about when this bug (read: > http://www.sqlite.org/lang_expr.html) will be fixed? > It isn't a bug. That is the way LIKE works. But you can change the behavior using: PRAGMA case_sensitive_like=ON; -- D. Richard Hipp

[sqlite] SQL Like expr not case sensitive Bug

2006-07-14 Thread Pasquale Imbemba
Hi, is there any news about when this bug (read: http://www.sqlite.org/lang_expr.html) will be fixed? Cheers Pasquale

[sqlite] Using Like

2006-04-13 Thread Roger
hwo do i use LIKE in sqlite eg in Select Surname from people where surname like A* etc.

Re: [sqlite] v3 like and collation

2004-07-22 Thread Miguel Angel Latorre Díaz
>You are correct that LIKE and GLOB only work for 7-bit ascii >strings. If you need a LIKE and GLOB that work with Unicode, >you can register alternative LIKE and GLOB functions using >the sqlite3_create_function() API. Yes, I know it can be done that way. BTW, I'm not using Unicode. :) I meant

Re: [sqlite] v3 like and collation

2004-07-21 Thread D. Richard Hipp
Miguel Angel Latorre Díaz wrote: Shoudn't the LIKE and GLOB function use a collation if present (either in column definition or by the COLLATE xxx word) ? The new collation functions are used to compare strings, and that's what LIKE and GLOB do (sort of). That way it would correctly handle the >

[sqlite] v3 like and collation

2004-07-21 Thread Miguel Angel Latorre Díaz
Shoudn't the LIKE and GLOB function use a collation if present (either in column definition or by the COLLATE xxx word) ? The new collation functions are used to compare strings, and that's what LIKE and GLOB do (sort of). That way it would correctly handle the > ASCII(127) characters. -- Miguel

<    1   2