<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.comp.db.sqlite.general">
    <title>gmane.comp.db.sqlite.general</title>
    <link>http://blog.gmane.org/gmane.comp.db.sqlite.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43004"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43003"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43002"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43001"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43000"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42999"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42998"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42997"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42996"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42995"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42994"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42993"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42992"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42991"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42990"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42989"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42988"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42987"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42986"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42985"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43004">
    <title>Re: query optimization for inner table join</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/43004</link>
    <description>2008/12/1 Igor Tandetnik &lt;itandetnik-fH9DrAxc5Jo&lt; at &gt;public.gmane.org&gt;:

Thank you very much, Igor. I would have not thought of that.

This is a nicely predictable single linear scan. Still not awfully
fast, but it will have to do.
Using an index on map(n,m) seems faster. This may be because the m
values are in the index and there is no need to access the table.

Cheers,
Jos
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Jos van den Oever</dc:creator>
    <dc:date>2008-12-01T16:36:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43003">
    <title>Missing TCL/TEA source code</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/43003</link>
    <description>I think the source code for SQLite with TCL for version 3.6.6.2 is
missing from sqlite.org.

Thanks,

glauber
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Ribeiro, Glauber</dc:creator>
    <dc:date>2008-12-01T16:23:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43002">
    <title>Re: SQLite aggregate functions by Tcl</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/43002</link>
    <description>Hello!

В сообщении от Monday 01 December 2008 18:16:04 D. Richard Hipp написал(а):

Do you think that this feature is not better way? May be aggregate operations is more preferable 
doing in application layer?

Best regards, Alexey.
_______________________________________________
sqlite-users mailing list
sqlite-users&lt; at &gt;sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
</description>
    <dc:creator>Alexey Pechnikov</dc:creator>
    <dc:date>2008-12-01T16:22:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43001">
    <title>Re: Journal files</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/43001</link>
    <description>
On Dec 1, 2008, at 10:50 AM, Eric Minbiole wrote:


And in particular http://www.sqlite.org/pragma.html#pragma_journal_mode


D. Richard Hipp
drh-X1OJI8nnyKUAvxtiuMwx3w&lt; at &gt;public.gmane.org



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>D. Richard Hipp</dc:creator>
    <dc:date>2008-12-01T15:55:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/43000">
    <title>Re: Journal files</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/43000</link>
    <description>
http://www.sqlite.org/pragma.html
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Eric Minbiole</dc:creator>
    <dc:date>2008-12-01T15:50:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42999">
    <title>Journal files</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42999</link>
    <description>Hello all,

                I am looking for a way to completely turn off the creation
of journal files. Any help is much appreciated.

 

Thanks.

_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Stephen Abbamonte</dc:creator>
    <dc:date>2008-12-01T15:46:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42998">
    <title>Re: SQLite aggregate functions by Tcl</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42998</link>
    <description>
On Dec 1, 2008, at 9:56 AM, Alexey Pechnikov wrote:


The current TCL interface for SQLite does not provide the ability to  
add aggregate functions written in TCL.  So in that sense, it is not  
possible.  However, the TCL interface could be extended to add this  
capability.


D. Richard Hipp
drh-X1OJI8nnyKUAvxtiuMwx3w&lt; at &gt;public.gmane.org



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>D. Richard Hipp</dc:creator>
    <dc:date>2008-12-01T15:16:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42997">
    <title>SQLite aggregate functions by Tcl</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42997</link>
    <description>Hello!

Is it possible?

Best regards, Alexey.
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Alexey Pechnikov</dc:creator>
    <dc:date>2008-12-01T14:56:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42996">
    <title>Re: Arranging of ids in Sqlite3</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42996</link>
    <description>Hello!

В сообщении от Wednesday 26 November 2008 13:57:02 Nikhil Kansal написал(а):

You can get rowid for last inserted row as

select last_insert_rowid();

Best regards, Alexey.
_______________________________________________
sqlite-users mailing list
sqlite-users&lt; at &gt;sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
</description>
    <dc:creator>Alexey Pechnikov</dc:creator>
    <dc:date>2008-12-01T14:23:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42995">
    <title>Re: query optimization for inner table join</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42995</link>
    <description>"Jos van den Oever" &lt;jvdoever-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt;
wrote in message
news:c2dbc4260812010126o8eb189ax9bdafdf662fea04a-JsoAwUIsXosN+BqQ9rBEUg&lt; at &gt;public.gmane.org

Try this:

select n from map
group by n
having
    count(case when m=3 then 1 else null end) != 0 and
    count(case when m=5 then 1 else null end) != 0 and
    count(case when m=7 then 1 else null end) = 0;

Having an index on map(n) should speed it up.

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Igor Tandetnik</dc:creator>
    <dc:date>2008-12-01T13:19:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42994">
    <title>Re: Why must one write a mini SQL parser to read thecolumnnames?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42994</link>
    <description>Thanks, that's perfect!

On Mon, Dec 1, 2008 at 3:06 PM, Igor Tandetnik &lt;itandetnik-fH9DrAxc5Jo&lt; at &gt;public.gmane.org&gt; wrote:
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Ben Harper</dc:creator>
    <dc:date>2008-12-01T13:10:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42993">
    <title>Re: Why must one write a mini SQL parser to read thecolumnnames?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42993</link>
    <description>"Ben Harper" &lt;rogojin-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote in
message
news:6def3e7b0812010502x32fb4d1ap96a2a0a1f278ff9d-JsoAwUIsXosN+BqQ9rBEUg&lt; at &gt;public.gmane.org

Have you looked at PRAGMA table_info?

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Igor Tandetnik</dc:creator>
    <dc:date>2008-12-01T13:06:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42992">
    <title>Why must one write a mini SQL parser to read the columnnames?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42992</link>
    <description>To the best of my findings, it seems to me that one needs to write a
mini SQL parser in order to read the 'sql' field from sqlite_master,
in order to discover the fields in an Sqlite table. Is this really a
necessary design? Would it not be better if
sqlite3_table_column_metadata had a mode that could enumerate the
columns in a table? Or am I missing something obvious?
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Ben Harper</dc:creator>
    <dc:date>2008-12-01T13:02:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42991">
    <title>Partial search with fts</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42991</link>
    <description>Previously someone advised that I use the "*" char to achieve partial search results with fts. eg ver* will match version. This works ok, but only for end parts of a word. 
 
Is there anyway to get partial matches for beginning or middle parts of a word?
 
e.g. *sion - to match version or
*si* to match version
 
Thanks
Rael


      
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Rael Bauer</dc:creator>
    <dc:date>2008-12-01T11:48:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42990">
    <title>Re: please help with NULL and NOTHING?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42990</link>
    <description>If you are sure there is at most one entry in bilance1 where the account
and year match then you could do this:

   SELECT coalesce(
     (SELECT dbs from bilance1 where account='13100' and pYear=?),
     0
   ) AS summadeb;





On Dec 1, 2008, at 3:26 PM, aivars wrote:


_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Dan</dc:creator>
    <dc:date>2008-12-01T11:18:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42989">
    <title>query optimization for inner table join</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42989</link>
    <description>Hi all,

I've trouble optimizing for an N:M mapping table. The schema of the
table is this:

CREATE TABLE map (n INTEGER NOT NULL, m INTEGER NOT NULL);

I want to retrieve a list of n filtered on the presence of certain
values of m, e.g. give me all n for which there is an m = 3 and m = 5,
but no m = 7.
A naive query would look like this:

SELECT a.n FROM map a, map b, map c
  WHERE a.n = b.n AND a.n = c.n AND a.m = 3 AND b.m = 5
         AND c.id not in (select id from map where c.m = 7);

This can be slow, even for the more simple case with only positive selection:

SELECT a.n FROM map a, map b
  WHERE a.n = b.n AND a.m = 3 AND b.m = 5;

And this variation does not make it a lot faster:

SELECT n FROM map WHERE m = 3 INTERSECT SELECT n FROM map where m = 5;

There are about a million entries in the table map and want to
increase to about 10 million.

The current indexes are

CREATE INDEX map_n ON map(n);
CREATE INDEX map_m ON map(n,m);

Is there a cleverer way of doing these queries?

The fraction of n's that has a particular m can be anywhere between 0 and 1.

Cheers,
Jos
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Jos van den Oever</dc:creator>
    <dc:date>2008-12-01T09:26:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42988">
    <title>Re: please help with NULL and NOTHING?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42988</link>
    <description>You should handle this in your client program. Even in MS SQL or Oracle, it 
will not return any resultset.
If you were to use left join, you may get it as NULL for any missing links.

rgd,
Radzi.

----- Original Message ----- 
From: "aivars" &lt;aivars868-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt;
To: &lt;sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org&gt;
Sent: Monday, December 01, 2008 4:26 PM
Subject: [sqlite] please help with NULL and NOTHING?




_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Mohd Radzi Ibrahim</dc:creator>
    <dc:date>2008-12-01T09:07:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42987">
    <title>please help with NULL and NOTHING?</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42987</link>
    <description>Hello,

The simple query is like this:
SELECT dbs as summadeb from bilance1 where account='13100' and pYear=?;

Account number 13100 is not present in the table bilance1 when
pYear=2005 and it should be like this and therefore dbs is also not
present. Other years account number 13100 is present and query works
OK.

When the query is run with a parameter pYear='2005' it returns nothing
- the resultset is empty or nothing? (I am doing it from python25)

Even if I change the query to :
SELECT coalesce(dbs,0) as summadeb from bilance1 where account='13100'
and pYear='2005'; it still returns NOTHING, not 0.

The same happens also on MS SQLServer 2005 so I think it should be
like that according to sql standards. If there is no account number
13100 in the table then the result is NOTHING, not NULL or 0.
Strictly speaking I think also the value of 0 is not correct in this
case but I would like to have it.
It seams that coalesce can handle NULL not NOTHING.

My question is:
Is there an SQL way to handle above query to return 0 or should I
handle this in client program (python)? (presently I get TypeError:
'NoneType' object is unsubscriptable)

Using sqlite 3.6.2, python2.5 and Windows XP

Thanks in advance

Aivars
_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>aivars</dc:creator>
    <dc:date>2008-12-01T08:26:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42986">
    <title>Re: Select Limit issues</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42986</link>
    <description>"Webmaster" &lt;webmaster-aUJy7+HJ0wFWk0Htik3J/w&lt; at &gt;public.gmane.org&gt; wrote
in message news:002a01c95368$eb234070$6501a8c0&lt; at &gt;Netactix

I meant that you would put an actual number in place of :X. Or else, 
that you would figure out how to work with parameterized queries in 
whatever environment you use SQLite with.

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Igor Tandetnik</dc:creator>
    <dc:date>2008-12-01T04:13:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42985">
    <title>Re: Select Limit issues</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42985</link>
    <description>This kind of problem, in my opinion, is more suited for the
application rather than SQL. Even if you get this to work, there are
several issues...

what happens if your dataset changes?

what happens if there are not enough Whites or Blues before or after
the first Red?

What happens if a White or a Blue gets intermingled/interchanged with
each other?

How do you maintain the order of the list that you get back? In your
original data, Field1 is definitely not the ordering column... see the
following rows

1218.90,White,12:00
18516.40,Blue,12:00
1255.33,White,12:00
927.46,White,12:00

etc. etc.

That said, see http://www.perlmonks.org/?node_id=726949 for a couple
of three solutions more suitably belonging in the application domain
rather than the SQL domain.


On 11/30/08, Webmaster &lt;webmaster-aUJy7+HJ0wFWk0Htik3J/w&lt; at &gt;public.gmane.org&gt; wrote:


</description>
    <dc:creator>P Kishor</dc:creator>
    <dc:date>2008-12-01T04:04:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.db.sqlite.general/42984">
    <title>Re: Select Limit issues</title>
    <link>http://permalink.gmane.org/gmane.comp.db.sqlite.general/42984</link>
    <description>Ok, Did that but now it doesn't run?

select * from (
    select * from table1 where Field2='Red' order by Field1 limit 1
offset :X)
union all
select * from (
    select * from table1 where Field2='White' and
    Field1 &lt; (select Field1 from table1 where Field2='Red' order by 
Field1 limit 1)
    order by Field1 desc limit 4
)
union all
select * from (
    select * from table1 where Field2='Blue' and
    Field1 &lt; (select Field1 from table1 where Field2='Red' order by 
Field1 limit 1)
    order by Field1 desc limit 1
)
union all
select * from (
    select * from table1 where Field2='White' and
    Field1 &gt; (select Field1 from table1 where Field2='Red' order by 
Field1 limit 1)
    order by Field1 limit 4
)
union all
select * from (
    select * from table1 where Field2='Blue' and
    Field1 &gt; (select Field1 from table1 where Field2='Red' order by 
Field1 limit 1)
    order by Field1 limit 1
)
order by Field1;



I take it I am missing something here?





-----Original Message-----
From: sqlite-users-bounces-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
[mailto:sqlite-users-bounces-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org] On Behalf Of Igor Tandetnik
Sent: Sunday, November 30, 2008 9:15 PM
To: sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
Subject: Re: [sqlite] Select Limit issues

"Webmaster" &lt;webmaster-aUJy7+HJ0wFWk0Htik3J/w&lt; at &gt;public.gmane.org&gt; wrote
in message news:000c01c9532d$c4919a00$6501a8c0&lt; at &gt;Netactix

Replace all subqueries that look like this:

(select Field1 from table1 where Field2='Red'
 order by Field1 limit 1)

with something like this:

(select Field1 from table1 where Field2='Red'
 order by Field1 limit 1 offset :X)

and vary X in the loop, starting from 0, until you get an empty 
resultset.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users-CzDROfG0BjIdnm+yROfE0A&lt; at &gt;public.gmane.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

</description>
    <dc:creator>Webmaster</dc:creator>
    <dc:date>2008-12-01T03:57:17</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.comp.db.sqlite.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.db.sqlite.general</link>
  </textinput>
</rdf:RDF>
