I was wondering if someone can tell me what i am missing here....I'm
trying to run a pretty complex query so I have decided to use
rawQuery. I need to use a '?' placeholder in two spots. The second '?'
is not getting recognized and therefore it keeps returning null. I
know the query itself is valid because if i put static values in place
of the '?' it returns expected results. I have used this query in a
SQLite Manager program with expected results. I have also used this
query in the iphone version of my app with no problems at all so i'm
pretty positive its how i am implementing it with Android.
Anyway.... If I put a value in place of the second '?' but keep the
first '?'  it also returns expected results. It's when i implement the
second '?' that it gets messed up.

This is the query....
"SELECT SUM(MIN(fp - ?, ap)) FROM
   (SELECT dates._id AS fd, SUM(points) AS fp
   FROM dates
   JOIN foods ON nameID=fd
   WHERE dates.weekly=1
   GROUP BY fd HAVING fp >= ?)
        JOIN
    (SELECT dates._id AS ad, SUM(activity) AS ap
    FROM dates
    JOIN activities ON activityID=ad
    WHERE dates.weekly=1
     GROUP BY ad) ON fd=ad"

and the way it is incorporated with Android
       return mDb.rawQuery("long query above", new String[] {first,
second});

The ? that follows "GROUP BY fd HAVING fp >= " is the problem one

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to