Frank Chang <frank_chan...@hotmail.com> wrote:
>  Hi, We are using the following schema :
> CREATE TABLE [BlobLastNameTest] ([FieldName] CHAR (25) PRIMARY KEY, 
> [Vertices] BLOB )
> 
> index|sqlite_autoindex_BlobLastNameTest_1|BlobLastNameTest|3|
> 
> 
> This table could potentially hold 10 to 40 million rows. We are using the 
> following query to obtain the minumum rowid for each
> unique LastName: 
> 
> sqlite> explain query plan select t1.FieldName,t1.rowid from BlobLastNameTest 
> t1
> GROUP BY t1.FIELDNAME HAVING t1.rowid = (SELECT MIN(rowid) FROM 
> BlobLastNameTes
> t where FieldName = t1.FIELDNAME);

This query doesn't do what you seem to think it does. If it works, it's only by 
accident. You probably want something as simple as

select FieldName, min(rowid) from BlobLastNameTest group by FieldName;

-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to