Re: [sqlite] Limit COUNT

2011-10-18 Thread Kit
2011/10/16 Fabian : > How can you limit a count-query? I tried: > SELECT COUNT(*) FROM table LIMIT 5000 SELECT min(COUNT(*),5000) FROM table; -- Kit ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Limit COUNT

2011-10-17 Thread Frank Missel
> boun...@sqlite.org] On Behalf Of Fabian > Sent: 17 October 2011 15:34 > > > No, I only want to have a capped total available. > > If I would go with Simons solution, I have to read the rows for the first > 100 pages (or whatever the cap is) into a temporary table, just to show the > first page.

Re: [sqlite] Limit COUNT

2011-10-17 Thread Kit
2011/10/16 Petite Abeille : > On Oct 16, 2011, at 10:39 PM, Kit wrote: >>> select count(*) from (select 1 from table limit 5000) >> SELECT count(1) FROM (SELECT 1 FROM table LIMIT 5000); > > you realize that count( * )  has a very specific meaning, right? > "The count(*)

Re: [sqlite] Limit COUNT

2011-10-17 Thread reseok
What about this: SELECT CASE count(*) WHEN 5000 THEN 'More than 5000' ELSE 'Less than 5000' END FROM (SELECT ID FROM table ORDER BY whatever LIMIT 5000 OFFSET 25000) Fabian schrieb: > 2011/10/16 Frank Missel > >> What do you want to attain with the count? >> >> > I want to

Re: [sqlite] Limit COUNT

2011-10-17 Thread Fabian
2011/10/16 Frank Missel > > But it sounds a bit like Fabian both wants to have the total number of > records available and at the same time limit the count. > > No, I only want to have a capped total available. If I would go with Simons solution, I have to read the rows for the

Re: [sqlite] Limit COUNT

2011-10-16 Thread Petite Abeille
On Oct 16, 2011, at 10:39 PM, Kit wrote: >> select count(*) from (select 1 from table limit 5000) > > SELECT count(1) FROM (SELECT 1 FROM table LIMIT 5000); you realize that count( * ) has a very specific meaning, right? "The count(*) function (with no arguments) returns the total number of

Re: [sqlite] Limit COUNT

2011-10-16 Thread Kit
> select count(*) from (select 1 from table limit 5000) SELECT count(1) FROM (SELECT 1 FROM table LIMIT 5000); -- Kit ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Limit COUNT

2011-10-16 Thread Petite Abeille
On Oct 16, 2011, at 1:09 PM, Fabian wrote: > How can you limit a count-query? I tried: > > SELECT COUNT(*) FROM table LIMIT 5000 > > But it ignores the LIMIT clause. No it doesn't, it works as advertised. You are falling into the same trap as you did just a couple of threads ago. You need

Re: [sqlite] Limit COUNT

2011-10-16 Thread Frank Missel
> boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: 16 October 2011 21:53 > > Perhaps he could read the rows LIMIT 100 into a buffer (after all, he's going > to need them eventually for when he displays them), then count how many > rows he got. Yeah, I would go that way also. But it sounds

Re: [sqlite] Limit COUNT

2011-10-16 Thread Roger Andersson
On 10/16/11 14:21, Fabian wrote: I want to allow users to paginate through a result set. The pages are retreived through LIMIT/OFFSET, but to calculate the total number of pages, I have execute a separate COUNT() query (without LIMIT) once. Because I'm basicly executing the same query twice

Re: [sqlite] Limit COUNT

2011-10-16 Thread Simon Slavin
On 16 Oct 2011, at 2:50pm, Bart Smissaert wrote: > He is trying to make it more efficient, so stop counting if count > X. > So setting the count after having counted the whole lot won't help. Then he can't use count() because SQLite's implementation of it is not efficient for that. Perhaps he

Re: [sqlite] Limit COUNT

2011-10-16 Thread Bart Smissaert
He is trying to make it more efficient, so stop counting if count > X. So setting the count after having counted the whole lot won't help. RBS On Sun, Oct 16, 2011 at 2:46 PM, Simon Slavin wrote: > > On 16 Oct 2011, at 1:21pm, Fabian wrote: > >> 2011/10/16 Frank Missel

Re: [sqlite] Limit COUNT

2011-10-16 Thread Simon Slavin
On 16 Oct 2011, at 1:21pm, Fabian wrote: > 2011/10/16 Frank Missel > >> What do you want to attain with the count? > > I want to allow users to paginate through a result set. The pages are > retreived through LIMIT/OFFSET, but to calculate the total number of pages, > I have

Re: [sqlite] Limit COUNT

2011-10-16 Thread Roger Andersson
On 10/16/11 14:21, Fabian wrote: I want to allow users to paginate through a result set. The pages are retreived through LIMIT/OFFSET, but to calculate the total number of pages, I have execute a separate COUNT() query (without LIMIT) once. Because I'm basicly executing the same query twice

Re: [sqlite] Limit COUNT

2011-10-16 Thread Fabian
2011/10/16 Frank Missel > > What do you want to attain with the count? > > I want to allow users to paginate through a result set. The pages are retreived through LIMIT/OFFSET, but to calculate the total number of pages, I have execute a separate COUNT() query (without LIMIT)

Re: [sqlite] Limit COUNT

2011-10-16 Thread Jos Groot Lipman
oun...@sqlite.org] On Behalf Of Fabian Sent: zondag 16 oktober 2011 13:09 To: General Discussion of SQLite Database Subject: [sqlite] Limit COUNT How can you limit a count-query? I tried: SELECT COUNT(*) FROM table LIMIT 5000 But it ignores the LIMIT clause. I think the workaround would be count

Re: [sqlite] Limit COUNT

2011-10-16 Thread Frank Missel
with the count? /Frank > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Fabian > Sent: 16 October 2011 19:09 > To: General Discussion of SQLite Database > Subject: [sqlite] Limit COUNT > > How can yo

[sqlite] Limit COUNT

2011-10-16 Thread Fabian
How can you limit a count-query? I tried: SELECT COUNT(*) FROM table LIMIT 5000 But it ignores the LIMIT clause. I think the workaround would be counting the results of a sub-query, but I'm trying to understand whats wrong with the syntax above. The goal is to make the engine stop iterating

Re: [sqlite] SQLITE LIMIT clause

2011-10-10 Thread Richard Hipp
> > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > -- > View this message in context: > http://old.nabble.com/SQLITE-LIMI

Re: [sqlite] SQLITE LIMIT clause

2011-10-10 Thread Igor Tandetnik
cricketfan wrote: > SELECT * FROM test WHERE PK1 > 100 LIMIT 100 ORDER BY PK1 ASC; > > Since I have the index on PK1, I believe the rows will be returned in the > ORDER of PK1. Putting an ORDER BY clause will be a no-op. Probably, but that's an implementation detail. If

Re: [sqlite] SQLITE LIMIT clause

2011-10-10 Thread cricketfan
t; http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://old.nabble.com/SQLITE-LIMIT-clause-tp32607006p32624793.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-user

Re: [sqlite] SQLITE LIMIT clause

2011-10-07 Thread Gabríel A. Pétursson
Be aware that if you do not specify an ORDER BY clause, the order of the returned rows are undefined. You might not even end up with rows with a primary key even near 100. What you probably want is: SELECT * FROM test WHERE PK1 > 100 LIMIT 100 ORDER BY PK1 ASC; Other than that, those two

Re: [sqlite] SQLITE LIMIT clause

2011-10-07 Thread Pavel Ivanov
00 > from it? > > I delete records in my table (it is like a queue implementation) so I might > have gaps in between which is why I want to use the LIMIT clause. > > Any advice would be greatly appreciated. > -- > View this message in context: &g

[sqlite] SQLITE LIMIT clause

2011-10-07 Thread cricketfan
nt to use the LIMIT clause. Any advice would be greatly appreciated. -- View this message in context: http://old.nabble.com/SQLITE-LIMIT-clause-tp32607006p32607006.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing li

Re: [sqlite] Limit Rows Retrieved

2009-07-03 Thread Igor Tandetnik
Rick Ratchford wrote: > Perhaps to solve the larger problem I have in a different post, I > have a question on retrieving records. > > How do you request a fixed number of records starting from a location > in the data based searched for, all in one SQL statement? > > "SELECT Date = '2009-01-01'

[sqlite] Limit Rows Retrieved

2009-07-03 Thread Rick Ratchford
Perhaps to solve the larger problem I have in a different post, I have a question on retrieving records. How do you request a fixed number of records starting from a location in the data based searched for, all in one SQL statement? "SELECT Date = '2009-01-01' ...plus the next x number of

Re: [sqlite] Limit to database and/or blob size on Mac/Windows?

2009-04-17 Thread Vinnie
> From: John Machin > Irrespective of what people tell you and how authoritative > they seem, I > would recommend that you do some simple tests: Excellent advice! Thanks! ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Limit to database and/or blob size on Mac/Windows?

2009-04-16 Thread John Machin
On 17/04/2009 12:01 AM, Vinnie wrote: > Dear Group: > > I've done some calculations and its a fairly likely scenario that my users > will end up with sqlite databases that are over 1 gigabyte in size, in some > cases 4 gigabytes. An upper limit on the number of rows in a table could be > as

Re: [sqlite] Limit to database and/or blob size on Mac/Windows?

2009-04-16 Thread Gerry Snyder
Vinnie wrote: > . > > Is there a limit to the database size on Windows or Macintosh? > > Does the following help? http://sqlite.org/limits.html ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Limit to database and/or blob size on Mac/Windows?

2009-04-16 Thread Vinnie
Dear Group: I've done some calculations and its a fairly likely scenario that my users will end up with sqlite databases that are over 1 gigabyte in size, in some cases 4 gigabytes. An upper limit on the number of rows in a table could be as high as 100,000 (yeah that not very high). There

Re: [sqlite] Limit Column Width

2008-04-07 Thread Fred J. Stephens
Dennis Cote wrote: > You can use the replace() function to strip the newlines from your > strings. You could replace the newlines with empty strings or with a > single space. The trick is entering the newlines. You can enter them > directly in an sql script file. > > select

Re: [sqlite] Limit Column Width

2008-04-07 Thread Dennis Cote
Fred J. Stephens wrote: > How can I limit the width of column returned by a query? > In a bash script I am returning an ID, and a text field from a table. > The text field can be any length, contain newlines, etc. The problems is > if a row of results contains a new line, the "grid" of rows and

[sqlite] Limit Column Width

2008-04-06 Thread Fred J. Stephens
How can I limit the width of column returned by a query? In a bash script I am returning an ID, and a text field from a table. The text field can be any length, contain newlines, etc. The problems is if a row of results contains a new line, the "grid" of rows and columns is messed up. I can

Re: [sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread P Kishor
On 2/20/08, Kalyani Phadke <[EMAIL PROTECTED]> wrote: > > Suppose I have 1280009 rows in table. > CREATE TABLE TableA > ( > ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, >column1 VARCHAR (50) NOT NULL, >column2 VARCHAR (50) NOT NULL, >column3 TIMESTAMP NOT NULL DEFAULT

Re: [sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread Dennis Cote
Kalyani Phadke wrote: > > Any suggestions? > Please stop hijacking message threads. http://en.wikipedia.org/wiki/Thread_hijacking Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org

RE: [sqlite] Limit selection by rolling sum?

2007-05-14 Thread Samuel R. Neff
- From: Steve Krulewitz [mailto:[EMAIL PROTECTED] Sent: Monday, May 14, 2007 8:26 PM To: sqlite-users@sqlite.org Subject: [sqlite] Limit selection by rolling sum? Hey all -- I have a table that I would like to select the first N records where the rolling sum of a given column is less than some literal

[sqlite] Limit selection by rolling sum?

2007-05-14 Thread Steve Krulewitz
Hey all -- I have a table that I would like to select the first N records where the rolling sum of a given column is less than some literal value. SQL for this might look like: select item_id from items where rolling_sum(item_size) < 1 order by item_name; Is there a way to do this? Would

RE: [sqlite] Limit statement size?

2007-01-31 Thread Joe Wilson
> I wonder what the reason was to limit the number of table joins to 32. http://www.sqlite.org/cvstrac/chngview?cn=3622 Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites

RE: [sqlite] Limit statement size?

2007-01-31 Thread RB Smissaert
us a nicer looking SQL. I wonder what the reason was to limit the number of table joins to 32. RBS -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: 01 February 2007 00:42 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? --- RB Smissaert <[EM

RE: [sqlite] Limit statement size?

2007-01-31 Thread Joe Wilson
--- RB Smissaert <[EMAIL PROTECTED]> wrote: > There is one important problem though that I just discovered. > Just found out that the maximum number of tables in a join is 32! > So, with my base table that is only 31 to add. Let's do some grepping... #define BMS (sizeof(Bitmask)*8) ... /*

RE: [sqlite] Limit statement size?

2007-01-31 Thread RB Smissaert
I could do is see how many tables are to be added and pick the method accordingly. RBS -Original Message- From: RB Smissaert [mailto:[EMAIL PROTECTED] Sent: 31 January 2007 17:54 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? Actually make that about 5 to 6

RE: [sqlite] Limit statement size?

2007-01-31 Thread RB Smissaert
Actually make that about 5 to 6 times as fast. RBS -Original Message- From: RB Smissaert [mailto:[EMAIL PROTECTED] Sent: 31 January 2007 17:39 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? Can confirm now that the method with INSERT OR REPLACE is faster indeed

RE: [sqlite] Limit statement size?

2007-01-31 Thread RB Smissaert
for the assistance. RBS -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: 31 January 2007 00:51 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? --- RB Smissaert <[EMAIL PROTECTED]> wrote: > I can see now what the trouble is if I do t

RE: [sqlite] Limit statement size?

2007-01-31 Thread RB Smissaert
son [mailto:[EMAIL PROTECTED] Sent: 31 January 2007 03:49 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? Your INSERT OR REPLACE statement is in error. You have fewer columns in your SELECT clause than are specified in your INSERT column name list. You should have seen an er

RE: [sqlite] Limit statement size?

2007-01-30 Thread Joe Wilson
Your INSERT OR REPLACE statement is in error. You have fewer columns in your SELECT clause than are specified in your INSERT column name list. You should have seen an error like this in SQLite version 3.3.12: SQL error: X values for Y columns Assuming PATIENT_ID is the sole unique key for

RE: [sqlite] Limit statement size?

2007-01-30 Thread Joe Wilson
e3_b > 3 30 31 23 230 > 4 40 41 24 240 > 5 50 51 25 250 > > id e2_ae2_be3_ae3_b > 3 300 310 23.1230.1 > 4 400 410 24.1240.1 > 5 500 510

RE: [sqlite] Limit statement size?

2007-01-30 Thread RB Smissaert
: [sqlite] Limit statement size? --- RB Smissaert <[EMAIL PROTECTED]> wrote: > Thanks, that is how I understood it to be. > I must be overlooking something simple here. Check your SELECT sub-statement within the REPLACE statement to see what rows it returns. .header on .mode tabs create

RE: [sqlite] Limit statement size?

2007-01-29 Thread Joe Wilson
410 24.1240.1 5 500 510 25.1250.1 > > RBS > > -Original Message- > From: Gerry Snyder [mailto:[EMAIL PROTECTED] > Sent: 29 January 2007 23:52 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Limit statement size? > > RB Smissaer

RE: [sqlite] Limit statement size?

2007-01-29 Thread RB Smissaert
Thanks, that is how I understood it to be. I must be overlooking something simple here. RBS -Original Message- From: Gerry Snyder [mailto:[EMAIL PROTECTED] Sent: 29 January 2007 23:52 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Limit statement size? RB Smissaert wrote: > Had a

Re: [sqlite] Limit statement size?

2007-01-29 Thread Gerry Snyder
RB Smissaert wrote: Had a go at this, but sofar I haven't been able yet to get it to work. I get no error, but A3Test115_J remains just at it is. I couldn't find much information about INSERT OR REPLACE in the SQLite documentation. What exactly should it do? It will try to do an INSERT. If the

RE: [sqlite] Limit statement size?

2007-01-29 Thread RB Smissaert
:[EMAIL PROTECTED] Sent: 28 January 2007 20:37 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? I forgot to specify the unique key for the table to be updated in the first attempt at INSERT OR REPLACE. Please try this... insert or replace into A3Test115_J( PATIENT_ID

RE: [sqlite] Limit statement size?

2007-01-28 Thread Joe Wilson
I forgot to specify the unique key for the table to be updated in the first attempt at INSERT OR REPLACE. Please try this... insert or replace into A3Test115_J( PATIENT_ID, ---<--- ENTRY_ID_E2, READ_CODE_E2, TERM_TEXT_E2, ... NUMERIC_VALUE_E15 ) select t1.PATIENT_ID,

Re: [sqlite] Limit statement size?

2007-01-28 Thread Joe Wilson
--- Joe Wilson <[EMAIL PROTECTED]> wrote: > I think this technique might be more compact and efficient than the update: I think my suggestion may result in duplicate rows. If the INSERT or REPLACE doesn't work, you might try: 1. BEGIN 2. dump the joined select into a temp table 3. delete the

RE: [sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
Thanks, will have a look at that. It definitely looks better. RBS -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: 28 January 2007 20:10 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Limit statement size? I think this technique might be more compact

Re: [sqlite] Limit statement size?

2007-01-28 Thread Joe Wilson
I think this technique might be more compact and efficient than the update: insert or replace into A3Test115_J( ENTRY_ID_E2, READ_CODE_E2, TERM_TEXT_E2, ... NUMERIC_VALUE_E15 ) select g2.ENTRY_ID, g2.READ_CODE, g2.TERM_TEXT, ... g15.NUMERIC_VALUE from A3Test115_J t1,

RE: [sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: 28 January 2007 19:14 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Limit statement size? --- Fred Williams <[EMAIL PROTECTED]> wrote: > Wow! Talk about obfuscated code! I didn't even try to dig deeper than > a quick scan, but c

RE: [sqlite] Limit statement size?

2007-01-28 Thread Joe Wilson
PROTECTED] > > Sent: Sunday, January 28, 2007 12:07 PM > > To: sqlite-users@sqlite.org > > Subject: [sqlite] Limit statement size? > > > > > > Is there any limit on the size of the SQL statements in SQLite? > > Didn't think this would come into play, but hav

RE: [sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
: Re: [sqlite] Limit statement size? You have any way to normalize that original source table? It's full of extents, which is the first sign of badness in a table design and assured of complicating your life. Clay RB Smissaert wrote: > Yes, I agree it looks messy, but I used to do this in st

Re: [sqlite] Limit statement size?

2007-01-28 Thread Clay Dowling
m Igor Tandenik I lumped it all together and run it in one go, > which is a lot faster. > > RBS > > -Original Message- > From: Fred Williams [mailto:[EMAIL PROTECTED] > Sent: 28 January 2007 18:49 > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Limit stat

RE: [sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
@sqlite.org Subject: RE: [sqlite] Limit statement size? Wow! Talk about obfuscated code! I didn't even try to dig deeper than a quick scan, but could this abomination be broken into multiple update queries? On the surface it looks like each "group" is unique. If so, wouldn't a t

RE: [sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
AIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 28 January 2007 18:20 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Limit statement size? "RB Smissaert" <[EMAIL PROTECTED]> wrote: > Is there any limit on the size of the SQL statements in SQLite? 32-bit integers are used to count th

RE: [sqlite] Limit statement size?

2007-01-28 Thread Fred Williams
efficient and a much lighter load on resources on a step by step basis? I damn well know it would be much more pleasing to the eye! :-) Fred > -Original Message- > From: RB Smissaert [mailto:[EMAIL PROTECTED] > Sent: Sunday, January 28, 2007 12:07 PM > To: sqlite-users@sqlite.

Re: [sqlite] Limit statement size?

2007-01-28 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > Is there any limit on the size of the SQL statements in SQLite? 32-bit integers are used to count things in various places. I don't really consider that a limit, but some people do. See http://www.sqlite.org/cvstrac/tktview?tn=2125 There may be other

[sqlite] Limit statement size?

2007-01-28 Thread RB Smissaert
Is there any limit on the size of the SQL statements in SQLite? Didn't think this would come into play, but have now come across this query and wonder if this needs considering: UPDATE A3Test115_J SET ENTRY_ID_E2 = (SELECT ENTRY_ID FROM GROUP_2 T WHERE PATIENT_ID = T.PID), READ_CODE_E2 = (SELECT

Re: [sqlite] LIMIT and paging records

2006-05-30 Thread Jay Sprenkle
On 5/29/06, Mikey C <[EMAIL PROTECTED]> wrote: I am using a web front end to display paged results. I need to tell the user how many records there are in total, how many pages and which page they are viewing. I would like to use the LIMIT keyword to restrict the result using the two

Re: [sqlite] LIMIT and paging records

2006-05-29 Thread John Stanton
This problem is as old as data processing. The "page N of M" situation which requires that the entire data set be read to get M. Once you have read the entire set you have many options on how you handle your window on that dataset. You could use local storage for it all or take advantage of

Re: [sqlite] LIMIT and paging records

2006-05-29 Thread John Stanton
To perform a count one has to read the entire dataset regardless. Why not implement your logic within your own program, using prepare and step and ceasing to unload data from the columns when you hit your predefined limit? JS Mikey C wrote: Hi, I think this has been discussed before, but I

Re: [sqlite] LIMIT and paging records

2006-05-29 Thread drh
"A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > > At the same time, to my knowledge, a query which has an `ORDER > BY` clause always has to produce all results before it can apply > a `LIMIT` to the result set, so at least in that case, what you > want should be possible. > Depends. SQLite will

Re: [sqlite] LIMIT and paging records

2006-05-29 Thread A. Pagaltzis
* Mikey C <[EMAIL PROTECTED]> [2006-05-29 17:10]: > Do you imagine Google loads 8 billions records into memory when > the user is just viewing 10 results in page 5 after a broad > search? You can’t ask Google for more than the first 1,000 hits on any search. (Go ahead and try.) There is a reason

Re: [sqlite] LIMIT and paging records

2006-05-29 Thread Mikey C
I don't think you really understand what I'm trying to say. Web based systems require paging that does not iterate through all records. What is required is a means to LIMIT the results read from the database but at the same time know how many records WOULD have been returned if the query was

[sqlite] LIMIT and paging records

2006-05-29 Thread Mikey C
Hi, I think this has been discussed before, but I can't find a good solution so I'll post it again to see what people think. Here's the problem. I have a large number of records in a table, which contains many columns. Hence a large amount of data. I have a SQL query that filters the results

RE: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread test mjom
Dennis, it works perfectly well, so thank you for your quick and relevant solution. test mjom <[EMAIL PROTECTED]> a écrit : Hi, i'm beginning with SQLite and it seems that the keyword LIMIT is not supported on an UPDATE statement. Does anybody would have a workaround to update only the very

Re: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread Derrell . Lipman
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Tue, Jan 03, 2006 at 10:15:17AM -0500, [EMAIL PROTECTED] wrote: >> test mjom <[EMAIL PROTECTED]> writes: >> >> > create table tbl1 ( id integer primary key autoincrement, ref >> > integer, sts varchar(16)); >> > insert into tbl1 (ref,sts)

Re: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread Dennis Cote
test mjom wrote: Hi, i'm beginning with SQLite and it seems that the keyword LIMIT is not supported on an UPDATE statement. Does anybody would have a workaround to update only the very first row matching the search criteria ? Ex : create table tbl1 ( id integer primary key

Re: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread Jim C. Nasby
On Tue, Jan 03, 2006 at 10:15:17AM -0500, [EMAIL PROTECTED] wrote: > test mjom <[EMAIL PROTECTED]> writes: > > > create table tbl1 ( id integer primary key autoincrement, ref > > integer, sts varchar(16)); > > insert into tbl1 (ref,sts) values (10, 'ready' ); > > insert into tbl1

Re: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread Dennis Cote
test mjom wrote: Hi, i'm beginning with SQLite and it seems that the keyword LIMIT is not supported on an UPDATE statement. Does anybody would have a workaround to update only the very first row matching the search criteria ? Ex : create table tbl1 ( id integer primary key

Re: [sqlite] LIMIT keyword does work in an UPDATE statement

2006-01-03 Thread Derrell . Lipman
test mjom <[EMAIL PROTECTED]> writes: > create table tbl1 ( id integer primary key autoincrement, ref > integer, sts varchar(16)); > insert into tbl1 (ref,sts) values (10, 'ready' ); > insert into tbl1 (ref,sts) values (20, 'ready' ); insert into tbl1 > (ref,sts) values (30, 'ready'

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Kurt Welgehausen
> Where in the documentation that explains how to use the sqlite substr() > function? Go to the SQLite Syntax page, and click on 'expression'.

RE: [sqlite] Limit how much data to read - substr syntax

2005-07-25 Thread Griggs, Donald
Regarding: Where in the documentation that explains how to use the sqlite substr() function? Hi Shawn, >From the main sqlite.org page, take the SYNTAX link, then EXPRESSIONS http://www.sqlite.org/lang_expr.html substr(X,Y,Z) Return a substring of input string X that begins with the Y-th

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Where in the documentation that explains how to use the sqlite substr() function? Cory Nelson wrote: Try the substr() function On 7/25/05, Shawn Walker <[EMAIL PROTECTED]> wrote: Is there a way to tell sqlite to read up to X bytes? For example, there are some data that can be quite large,

Re: [sqlite] Limit how much data to read

2005-07-25 Thread Cory Nelson
Try the substr() function On 7/25/05, Shawn Walker <[EMAIL PROTECTED]> wrote: > Is there a way to tell sqlite to read up to X bytes? For example, there > are some data that can be quite large, but I don't need all of them, > just a little bit of it to show the user some of the data and they can

[sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Is there a way to tell sqlite to read up to X bytes? For example, there are some data that can be quite large, but I don't need all of them, just a little bit of it to show the user some of the data and they can select that data to get the rest of the data from the DB.

Re: [sqlite] LIMIT does not speed up query execution

2004-09-05 Thread D. Richard Hipp
hilaner wrote: And - if I have to have sorted results as a small (but ordered!) part of big amount of data - there is no way to make it faster... SQLite will pull records out of the database in sorted order, if you have an index on the columns of the ORDER BY clause and you don't need to use a

Re: [sqlite] LIMIT does not speed up query execution

2004-09-05 Thread hilaner
Christian Smith wrote: > Query (2) has an extra condition in the WHERE clause, thus reducing > the result set size to be sorted. As sorting is probably an > O(n.log(n)) operation, halving the result set will more than halve > the time taken to sort, for example. Add that extra condition to >

Re: [sqlite] LIMIT does not speed up query execution

2004-09-05 Thread Christian Smith
On Sat, 4 Sep 2004, Darren Duncan wrote: >So to make this faster you either have to make WHERE return fewer >rows (better), or let it return more but remove the ORDER BY. It's not a good idea to use LIMIT on unordered results, of course, as the order of results for unordered result sets is,

Re: [sqlite] LIMIT does not speed up query execution

2004-09-04 Thread Darren Duncan
Adam, your query using LIMIT and a less-restricting WHERE is slower because you have an ORDER BY clause. ORDER BY is always one of the slowest things you can do in a query because every record returned by WHERE (or HAVING if you're using GROUP BY) has to be compared to every other record for

[sqlite] LIMIT does not speed up query execution

2004-09-04 Thread hilaner
Hi all! Since my database growed to more than 20 000 records, I have noticed that select limited to a few numer of records by LIMIT takes much more time than select limited to similar number of records by another WHERE condition. I use sqlite_get_table function. In my case I have the following

[sqlite]limit database size

2004-05-30 Thread Rex
Hi all, How can I limit the size of database size? I find that the SQLITE_MAX_PAGE,SQLITE_PAGE_SIZE in pager.h, are they used to limit the size of database size? Regards, Rex

[sqlite] Limit option

2003-12-30 Thread KL Chin
Hi Everyone, I don't know this was problem or not. I'm using version 2.8.8. I have a table with 350 record, With below Query I got 5 records, (which suppose to be result i want) SELECT DISTINCT LangNo, MovieSTK FROM VoIS WHERE BranchSMS='GKL1' AND DateID='2' AND LangNo BETWEEN 1 AND 5 ORDER

<    1   2