Re: [sqlite] Query executes in sqlite manager but not sqlite database in android

2014-01-26 Thread Kamulegs
Hello

I have used 
#sqlite3 --version
at command line and got 3.6.22 as the version 
Does that mean the type of query i am trying wont work?





On Sunday, January 26, 2014 8:57 AM, big stone [via SQLite] 
 wrote:
 
It seems Android use a pretty outdated SQlite motor : SQlite 3.7.1 = march 
20th, 2012 

http://stackoverflow.com/questions/2421189/version-of-sqlite-used-in-android

SQLite 3.7.11: 

    19-4.4-KitKat 
    18-4.3-Jelly Bean 
    17-4.2-Jelly Bean 
    16-4.1-Jelly Bean 

SQLite 3.7.4: 

    15-4.0.3-Ice Cream Sandwich 
    14-4.0-Ice Cream Sandwich 
    13-3.2-Honeycomb 
    12-3.1-Honeycomb 
    11-3.0-Honeycomb 

SQLite 3.6.22: 

    10-2.3.3-Gingerbread 
    9-2.3.1-Gingerbread 
    8-2.2-Froyo 

SQLite 3.5.9: 

    7-2.1-Eclair 
    4-1.6-Donut 
    3-1.5-Cupcake 
___ 
sqlite-users mailing list 
[hidden email] 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



 
If you reply to this email, your message will be added to the discussion 
below:http://sqlite.1065341.n5.nabble.com/Query-executes-in-sqlite-manager-but-not-sqlite-database-in-android-tp73466p73477.html
 
To unsubscribe from Query executes in sqlite manager but not sqlite database in 
android, click here.
NAML



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Query-executes-in-sqlite-manager-but-not-sqlite-database-in-android-tp73466p73478.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Query executes in sqlite manager but not sqlite database in android

2014-01-25 Thread Kamulegs
Hello Community

Hope to get some pointers here because i have a hit a snag!

I have 4 tables.

Meters:_id, SerialNumber
Tenants: _id, FirstName.
TenantsMeters: _id,Tenant_id,Meter_id, (basically junction table for linking
many to many relationship btn tenants and meters)

MeterReading: _id, ReadingDate, Reading, TenantMeter_id(FK for TenantMeters
table)

This query works in sqlite manager 
*SELECT M._id as Meter_id, M.MeterNumber, R1.ReadingDate as ReadingDate,
R1.Reading AS CurrentReading, R2.ReadingDate AS PrevReadingDate, R2.Reading
AS PrevMeterReading, R2.Rate as Rate, R2._id as _id,R1.TenantMeter_id
FROM (Meters AS M INNER JOIN TenantMeters ON M._id = TenantMeters.Meter_id)
INNER JOIN (MeterReading AS R1 INNER JOIN MeterReading AS R2 ON
R1.TenantMeter_id = R2.TenantMeter_id) ON TenantMeters._id =
R1.TenantMeter_id
WHERE (((R2.ReadingDate)=(SELECT Max(R3.ReadingDate) 
  FROM [MeterReading] AS R3   
  WHERE (R3.TenantMeter_id = R1.TenantMeter_id)   
AND (R3.ReadingDate < R1.ReadingDate) 
))) OR (((R2.TenantMeter_id) Is Null))
*

But fails in sqlite database in android with the error "no such
column:R1.ReadingDate"

It fails in android app and also fails when i connect to the android sqlite
db from command prompt .

What can be the likely cause?

Any pointers please. 

Ronald



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Query-executes-in-sqlite-manager-but-not-sqlite-database-in-android-tp73466.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users