That's because I posted the whole query and the whereClause is only supposed to be "where association.parentid = 'guid'". I'm not sure how to do the join here though. If it used a regular PreparedStatement, it'd be easy :-). I'm just not used to doing it this way. Maybe you can search google or the groups for info on how to do a join.
On Apr 9, 7:40 pm, SnowDrifter <[EMAIL PROTECTED]> wrote: > So I think I have the where clause setup right now but I can't seem to > get it to work. currently I am using it like so: > > db.query("child", new String[] {"_id", "title"}, whereClause, null, > null, null, null); > > my where clause looks like so: > > String whereClause = "select * from child join association on > association.childid = child._id where association.parentid = 'guid'"; > > where I replace 'guid' with my passed in guid for the lookup parent > guid. > > I think I am doing it wrong since I get a error about a syntax error > near "select". I don't believe I am allowed to use the where in this > location but I can't find a function that will take it. > > What should I be using? > > On Apr 6, 12:59 pm, "Dan U." <[EMAIL PROTECTED]> wrote: > > > I haven't tested this but it should be something like... > > > select child.* from child join association on child.guid = > > association.child_guid where association.parent_guid = ? > > > And of course, you should change child.* to be whatever columns you > > need and the ? should be your particular parent guid. > > > On Apr 6, 10:24 am, SnowDrifter <[EMAIL PROTECTED]> wrote: > > > > I am trying to figure out how to create a where clause (I think that > > > is what I need) to filter one table with the data from another table. > > > > I have three tables. One is for "parents" one is for "children" and > > > one is for associations between these two tables. The way I have done > > > this is using GIUD identifiers to identify the parents and children. > > > In the association table I just have GUID pairs to show the > > > association. > > > > So a parent or child table might look like so: > > > GUID, title, data > > > > and the association table might look like so: > > > GUID(parent), GUID(child) > > > > so I want to be able to do a query that does a query against the child > > > table and returns only a cursor of children that are associated with a > > > particular parent. > > > > I can't seem to find any good tutorials on how to do such a thing. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---