我有一个带有utf-8编码的法语SQLite数据库,我正在尝试按字母顺序组织我的类别。我的设置目前如下:http://i.imgur.com/cqNW1eS.png
我尝试添加SELECT DISTINCT Category FROM 'Main Database' ORDER BY name
,但遗憾的是它无法正确显示。任何人都可以告诉我在ABC顺序中按字母顺序排列Category
列的正确方法吗?
使用Javascript:
function onDeviceReady() {
if (window.device.platform === 'iOS' && parseFloat(window.device.version) >= 7.0)
StatusBar.overlaysWebView(false);
db = window.sqlitePlugin.openDatabase({name: "treatfinder", bgType: 1});
db.transaction(function(tx){
tx.executeSql("SELECT DISTINCT Category FROM 'Main Database'",[],function(tx,res){
//console.log("Number of Categories: " + res.rows.length);
var len = res.rows.length;
for (var i=0; i < len; i = i + 1) {
$("#allRepos").append("<li><a href='treatsymptoms.html?category=" + res.rows.item(i).Category + "'>"
+ res.rows.item(i).Category + "</a></li>");
}
$('#allRepos').listview('refresh');
});
})