SQLite Forum

SELECT skips empty fields ?
Login
Hello all,

A novice (in regard to sqlite3) here.

I've been trying to write a generic sqlite3 browser where I do a SELECT providing the current data to retrieve the next or previous screen-full :

SELECT * FROM moz_places WHERE (title, id) >= (?1, ?9) ORDER BY title, id LIMIT 34;

This seems to work well **as long as** the selected and sorted on field (title) contains _something_.   When it contains nothing (returning empty strings) all the empty fields are skipped.    

I thought I had bolted that down by providing the primary key as the last one, but I seem to have been wrong there.

I've tried to evoke the same behaviour on a colum that contains rows upon rows of the same string or value, but there everything works OK.

Question: 
What is goinging on there, and what do I need to do to fix it ?

Also, I noticed that in the WHERE clause I can group fields, but cannot(?) do that in the ORDER BY clause - "ORDER BY (title, id) DESC" does not seem to work.  Yet, I do not get an error.  What is the above ORDER BY supposed to be doing ?