lundi 16 mars 2015

Simple sqlite query with ascending order

Im working with QT and using sqlite. When I write this:



QSqlQuery q = db_.exec("SLECT *"
"From history;");


It works as expected, but with this I got nothing:



QSqlQuery q = db_.exec("SLECT *"
"From history"
"ORDER BY id ASC;");


This is the table creation:



db_.exec("CREATE TABLE IF NOT EXISTS history ("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
"url TEXT,"
"day REAL,"
"month REAL,"
"year REAL,"
"hour REAL,"
"minute REAL,"
"second REAL"
");");


Thanks


Aucun commentaire:

Enregistrer un commentaire