Hi,

create table test (column text);
create index idx on text(column);[IN uses index]

insert into test values ('9');
insert into test values ('98');
insert into test values ('985');

My Query: see if u have any record
98451234 which has a similar pattern.

select * from test where column in 
('98451234','9845123','984512','98451',
 '9845','984','98','9','-1') limit 1;

even when limit 1 is provided it continues to search.

Pls suggest a better way.

regards
ragha
******************************************************************************************
 This email and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!
 
*****************************************************************************************

----- Original Message -----
From: Christian Smith <[EMAIL PROTECTED]>
Date: Sunday, September 2, 2007 8:15 pm
Subject: Re: [sqlite] Difference between OR and IN 
[http://www.sqlite.org/php2004/page-052.html]

> Once you get your first row back (corresponding to (a==1), simply 
> halt 
> there and sqlite3_finalize() or sqlite3_reset the statement. You 
> control 
> the execution and how many rows you want back.
> 
> 
> RaghavendraK 70574 uttered:
> 
> > Hi,
> >
> > Ok.
> >
> > Is there any way to tell the VDBE to stop execution moment it 
> gets a record
> > from the IN list rather than continue to query for all the 
> parameters?>
> > I mean can it work like the C if clause
> > a = 1;
> > b = 100;
> > if( a == 1 or b == 10)
> > {
> > }
> >
> > in the above case a is evauated but not b. Is this possible in 
> SQL or SQLite?
> > Pls suggest.
> >
> > regards
> > ragha
> >
> >
> > 
> ******************************************************************************************>
>  This email and its attachments contain confidential information from HUAWEI, 
> which is intended only for the person or entity whose address is listed 
> above. Any use of the information contained herein in any way (including, but 
> not limited to, total or partial disclosure, reproduction, or dissemination) 
> by persons other than the intended recipient(s) is prohibited. If you receive 
> this e-mail in error, please notify the sender by phone or email immediately 
> and delete it!
> > 
> *****************************************************************************************>
> > ----- Original Message -----
> > From: Trevor Talbot <[EMAIL PROTECTED]>
> > Date: Sunday, September 2, 2007 1:03 am
> > Subject: Re: [sqlite] Difference between OR and IN 
> [http://www.sqlite.org/php2004/page-052.html]
> >
> >> On 9/1/07, RaghavendraK 70574 <[EMAIL PROTECTED]> wrote:
> >>
> >>> I want to know why
> >>> prepareStatement: select * from xxx where IN (?);
> >>> stmt.bind("abc,xyz,123"); is not supported for multiple
> >>> values.
> >>
> >> It's not supported because it doesn't make sense.  The parametric
> >> binding mechanism is for single values; it's not a macro-like text
> >> replacement system.  With your syntax, how do I bind a set of
> >> integers?  Strings?  Blobs?
> >>
> >> One common use for parametric binding (besides convenience) is to
> >> avoid SQL injection attacks.  The example you posted doesn't do 
> that;>> you have to manually escape each individual value to make 
> sure it's
> >> valid syntax for the IN() group in text form.  Why even use 
> parameters>> in that case?  It's the same amount of work whether 
> you build the
> >> entire SQL statement or not.
> >>
> >> All common databases I'm aware of work exactly the same way.
> >>
> >> -----------------------------------------------------------------
> --
> >> ----------
> >> To unsubscribe, send email to [EMAIL PROTECTED]
> >> -----------------------------------------------------------------
> --
> >> ----------
> >>
> >>
> >
> > ------------------------------------------------------------------
> -----------
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > ------------------------------------------------------------------
> -----------
> >
> 
> --
>     /"\
>     \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
>      X                           - AGAINST MS ATTACHMENTS
>     / \
> 
> --------------------------------------------------------------------
> ---------
> To unsubscribe, send email to [EMAIL PROTECTED]
> --------------------------------------------------------------------
> ---------
> 
> 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to