Re: Trouble with using "IN" for a sub-query statement
Chris wrote: Chris White wrote: On Monday 07 August 2006 12:13 pm, William DeMasi wrote: I meant to have it say : "select * from c2iedm_dev2.act where act_id IN (select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24);" What does the output of (the subselect): select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24; show? Sorry about that, typo on my part, but I have tried it as above and I get the error I mentioned. What version of mysql are you using? select version(); subselects don't work for versions before v5. You are right to inquire about version, but subselects are supported in mysql starting with 4.1. Michael -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trouble with using "IN" for a sub-query statement
Chris White wrote: On Monday 07 August 2006 12:13 pm, William DeMasi wrote: I meant to have it say : "select * from c2iedm_dev2.act where act_id IN (select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24);" What does the output of (the subselect): select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24; show? Sorry about that, typo on my part, but I have tried it as above and I get the error I mentioned. What version of mysql are you using? select version(); subselects don't work for versions before v5. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trouble with using "IN" for a sub-query statement
On Monday 07 August 2006 12:13 pm, William DeMasi wrote: > I meant to have it say : > > "select * from c2iedm_dev2.act where act_id IN (select obj_act_id from > > c2iedm_dev2.act_functl_assoc where subj_act_id =24);" What does the output of (the subselect): select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24; show? > Sorry about that, typo on my part, but I have tried it as above and I get > the error I mentioned. -- Chris White PHP Programmer/DBlinds Interfuel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trouble with using "IN" for a sub-query statement
On Monday 07 August 2006 12:02 pm, William DeMasi wrote: > The select statement I am trying to run is: > "select * from c2iedm_dev2.act where act_id =(select obj_act_id from > c2iedm_dev2.act_functl_assoc where subj_act_id =24);" Well the problem I'm seeing is that you're not using IN anywhere in the SQL clause. -- Chris White PHP Programmer/DBaby Interfuel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Trouble with using "IN" for a sub-query statement
The select statement I am trying to run is: "select * from c2iedm_dev2.act where act_id =(select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_act_id =24);" But I get the error below: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select obj_act_id from c2iedm_dev2.act_functl_assoc where subj_" I have looked at the documentation for MySQL and this seems to be the correct syntax for using "IN". Could someone please let me know what is wrong? Thank you. William DeMasi -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]