从sqlite数据库钛中检索多个表中的数据

时间:2015-01-11 16:48:06

标签: database sqlite titanium left-join

我试图使用带有左连接属性的select语句从sqlite数据库中的多个表中检索数据。

它检索null或undefined我和sqlite管理员一起使用了这个语句,它检索数据 你可以查看我的代码:

var db = Ti.Database.install('Path/DB_Name.s3db', 'DB_Name');
var rows = db.execute(
     'select c.CustomerID,c.Name, c.CustomerCode,v.ConfirmationDate  from  Customer as c' +
     ' left join Visits as v on c.CustomerID==v.CustomerID ' +
     '  order by  v.ConfirmationDate desc');

1 个答案:

答案 0 :(得分:0)

试试这样:

var db = Ti.Database.install('Path/DB_Name.s3db', 'DB_Name');
var rows = db.execute(
 'select c.CustomerID,c.Name, c.CustomerCode,v.ConfirmationDate  from  Customer as c' +
 ' left join Visits as v on c.CustomerID=v.CustomerID ' +
 '  order by  v.ConfirmationDate desc');

单身" ="