mardi 13 octobre 2015

Converting an SQLite command to an appropriate contentResolver query

I have this SQL query, and since I'm willing to use content://sms/inbox I can't pass it using rawQuery, and will have to use a contentResolver. And I have no idea how to do that.

It's supposed to return the most recent SMS recieved for each number.

Here's the SQL, if you can help me with that :/

SELECT adress, id, date /*Columns from the SMS contentResolver*/
FROM sms_databse /*Uri.parse("content://sms/inbox"); ????*/
WHERE (
SELECT COUNT(*) AS "s"
FROM sms_databse /*Uri.parse("content://sms/inbox"); ????*/
WHERE s.adress = sms_database.adress
AND s.date <= sms_database.date
)
<=1

Aucun commentaire:

Enregistrer un commentaire