Hi!

Something like this should work:

subselect
        .field("id")
        .from("table_b");

myselect
        .from(MY_TABLE)
        .where("id", "IN", subselect);

Note that the above code is sort of psuedo-code. I'm pretty sure I
remember the syntax correctly, but I didn't test it. So, YMMV.

Thanks,
--
JR

On Thu, 2006-08-03 at 20:46 +0200, Henk wrote:
> Hi,
> 
> I would like to execute a query like this :
> select * from table_a where id in (select id from table_b).  What is the 
> right syntax to use ?
> I tried first without the subselect :
> myselect.from(MY_TABLE).where("id","in","("+StringUtils.join(idList,",")+")")
> but this generates a query like
> SELECT * FROM mytable WHERE id in '(10,10)
> You notice the ' ?
> 
> Can someone help ?
> 
> Thanks
> 
> Henk
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://lists.uwyn.com/mailman/listinfo/rife-users

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to