Hi all,

Is there a way to specify an ORDER BY clause by column value?

I have a table declared as:
CREATE TABLE Table1 (id INTEGER PRIMARY KEY AUTOINCREMENT, obj_id INTEGER, 
prop_key TEXT, prop_value TEXT, prop_tag TEXT DEFAULT '*', UNIQUE(obj_id, 
prop_key, prop_tag))

and a sample query:
SELECT prop_value FROM Table1 WHERE obj_id=10 AND prop_key='key1' AND 
(prop_tag='ios' OR prop_tag='*') ORDER BY (prop_tag='ios') LIMIT 1;

I would like to prioritise results based on the fact that the prop_tag column 
is 'ios'.

Thanks.
--
Marco Bambini
https://www.sqlabs.com




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

Reply via email to