Florian Weimer, >>A better query needs support for DISTINCT ON, which SQLite lacks >>AFAIK. But speed will obviously be limited because you cannot avoid >>traversing the index for the whole table. I read your email and found it to be very interesting. PostgresSQL supports DISTINCT ON. However sqlite does not support it yet as you point you in your post. So, on the PostgresSQL thread http://www.postgresonline.com/journal/archives/4-Using-Distinct-ON-to-return-newest-order-for-each-customer.html , I found that they recommended simulating DISTINCT ON by using a subselect correlated subquery with either MAX(ROWID) OR MIN(ROWID) which is what I tried to do in my query. I was wondering if you knew when sqlite might add the DISTINCT ON clause. Also , is there any way which you can suggest where I can write a query or/and index which only traverses the index (CREATE INDEX claramary on BLOBLASTNAMETEST(FIELDNAME) for each distinct FIELDNAME/last name? Thank you. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users