Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread John Elrick
Sam Carleton wrote: > > SNIP I take it the brain removal was necessary for the politician to attain higher office? >>> I cannot see that being the case, they get worse off as they climb >>> the ranks, not better off! >>> >> >> I meant the politician having brain

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread Sam Carleton
John Elrick wrote: Sam Carleton wrote: John Elrick wrote: John Stanton wrote: Igor Tandetnik wrote: John Stanton wrote: Shane Harrelson wrote: Additionally, it's important to note

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread John Elrick
Sam Carleton wrote: > > > John Elrick wrote: >> John Stanton wrote: >> >>> Igor Tandetnik wrote: >>> John Stanton wrote: > Shane Harrelson wrote: > >> Additionally, it's important to note that the LIMIT/OFFSET clause

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread Sam Carleton
John Elrick wrote: John Stanton wrote: Igor Tandetnik wrote: John Stanton wrote: Shane Harrelson wrote: Additionally, it's important to note that the LIMIT/OFFSET clause is not standard SQL

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread John Elrick
John Stanton wrote: > Igor Tandetnik wrote: > >> John Stanton wrote: >> >> >>> Shane Harrelson wrote: >>> >>> Additionally, it's important to note that the LIMIT/OFFSET clause is not standard SQL >>> What makes you

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread John Stanton
My error. I was replying to the wrong email. Shane Harrelson wrote: > We're not talking about transaction control - we're talking about limiting > the size of the result set. And LIMIT/OFFSET clauses are not supported by > the SQL-92 standard. LIMIT is listed as a reserved word, but that's

Re: [sqlite] most efficient way to get 1st row

2009-05-21 Thread John Stanton
Igor Tandetnik wrote: > John Stanton wrote: > >> Shane Harrelson wrote: >> >>> Additionally, it's important to note that the LIMIT/OFFSET clause is >>> not standard SQL >>> >> What makes you think that transaction control is not part of SQL-92? >> > >

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread Shane Harrelson
We're not talking about transaction control - we're talking about limiting the size of the result set. And LIMIT/OFFSET clauses are not supported by the SQL-92 standard. LIMIT is listed as a reserved word, but that's it. http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt On Wed,

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread Igor Tandetnik
John Stanton wrote: > Shane Harrelson wrote: >> Additionally, it's important to note that the LIMIT/OFFSET clause is >> not standard SQL > > What makes you think that transaction control is not part of SQL-92? What does LIMIT clause have to do with transaction control, in

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread John Stanton
What makes you think that transaction control is not part of SQL-92? If a database engine does not support transaction control it is not a full implementation. Transaction control is at the very heart of effective data management. Shane Harrelson wrote: > Additionally, it's important to

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread Sam Carleton
I just learned today that Interbase 7.5 does not support it either. Shane Harrelson wrote: Additionally, it's important to note that the LIMIT/OFFSET clause is not standard SQL, and although it is supported by SQLite, and many other SQL engines, there are some that do NOT support it, most

Re: [sqlite] most efficient way to get 1st row

2009-05-20 Thread Shane Harrelson
Additionally, it's important to note that the LIMIT/OFFSET clause is not standard SQL, and although it is supported by SQLite, and many other SQL engines, there are some that do NOT support it, most notably Microsoft SQL Server. HTH. -Shane On Tue, May 19, 2009 at 2:23 PM, Sam Carleton

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Kees Nuyt wrote: Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset before it can return the first row in the resultset. Need I say more? http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor Thank you for the link, it is a VERY useful read, VERY useful! Sam

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Kees Nuyt
On Tue, 19 May 2009 11:26:31 -0400, Sam Carleton wrote: >Marco Bambini wrote: >> SELECT ... LIMIT 1; >> >Marco, Is this to say that adding the LIMIT 1 does make it more efficient? Not necessarily. Imagine a SELECT with an ORDER BY which makes SQLite sort the resultset

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Simon Slavin
On 19 May 2009, at 4:26pm, Sam Carleton wrote: > Marco Bambini wrote: >> SELECT ... LIMIT 1; >> > Marco, Is this to say that adding the LIMIT 1 does make it more > efficient? LIMIT does not make the query (much) more efficient: the software still needs to do the same filtering and sorting,

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
Marco Bambini wrote: SELECT ... LIMIT 1; Marco, Is this to say that adding the LIMIT 1 does make it more efficient? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] most efficient way to get 1st row

2009-05-19 Thread Marco Bambini
SELECT ... LIMIT 1; -- Marco Bambini http://www.sqlabs.com http://www.creolabs.com/payshield/ On May 19, 2009, at 5:03 PM, Sam Carleton wrote: > I am far from a SQL expert, but I am 99.9% sure there is SQL syntax > to limit > the number of results, I have not looked it up but I will in

[sqlite] most efficient way to get 1st row

2009-05-19 Thread Sam Carleton
I am far from a SQL expert, but I am 99.9% sure there is SQL syntax to limit the number of results, I have not looked it up but I will in a little while... I only need one result. Since I am working with the C/C++ API, I plan to simply call sqlite3_step() only once. Is there any point in using