RE: Convert subselect query to pre-subselect query

2004-10-08 Thread Ed Lazor
Doh... Guess I spoke too soon. I get it now. I wasn't seeing a.CategoryID=b.ID =) > -Original Message- > select a.ID > from products a, categories b > where a.CategoryID=b.ID and (b.ID='21' OR b.ParentID='21') -- MySQL General Mailing List For list archives: http://lists.mysql.co

RE: Convert subselect query to pre-subselect query

2004-10-08 Thread Ed Lazor
--Original Message- > From: Remi Mikalsen [mailto:[EMAIL PROTECTED] > Sent: Friday, October 08, 2004 5:07 PM > To: [EMAIL PROTECTED] > Subject: Re: Convert subselect query to pre-subselect query > > Try this... > > select a.ID > from products a, categories b > where a.

Re: Convert subselect query to pre-subselect query

2004-10-08 Thread Remi Mikalsen
Try this... select a.ID from products a, categories b where a.CategoryID=b.ID and (b.ID='21' OR b.ParentID='21') The query is pretty straigthforward and I believe it's quite easy to understand. Hope this is what you wanted! A tip... only use left and right joins whenever you want what is on t

Convert subselect query to pre-subselect query

2004-10-08 Thread Ed Lazor
Hi Everyone, I got excited when I discovered subselects, but quickly discovered that 4.1 is still in gamma and I can't put it onto my production server. The query I wanted to use would be great, so maybe there's a way to convert it - since the manual says most subselects can be done with joins.

re: SubSelect Query

2002-10-03 Thread Egor Egorov
vinita, Thursday, October 03, 2002, 5:56:49 AM, you wrote: vvM> mysql> select userGroup from machineGroup_userGroups where hostname="mulga"; vvM> +---+ vvM> | userGroup | vvM> +---+ vvM> | staff | vvM> | tech | vvM> +---+ vvM> 2 rows in set (0.01 sec) vvM> mysql>

SubSelect Query

2002-10-02 Thread vinita vigine Murugiah
HI all' mysql> select userGroup from machineGroup_userGroups where hostname="mulga"; +---+ | userGroup | +---+ | staff | | tech | +---+ 2 rows in set (0.01 sec) mysql> select username from account where loginGroup="staff" OR loginGroup="tech"; +--+ | use

Re: subselect query

2002-04-15 Thread Christopher Thompson
http://www.mysql.com/documentation/mysql/bychapter/manual_Introduction.html#ANSI_diff_Sub-selects On Monday 15 April 2002 2:49 pm, Jeff Shipman wrote: > Yeah, that nasty thing with temporary tables and > such? Or am I looking at the wrong page? If you > could point me in the right direction, I'd

Re: subselect query

2002-04-15 Thread Jeff Shipman
Yeah, that nasty thing with temporary tables and such? Or am I looking at the wrong page? If you could point me in the right direction, I'd appreciate it (slow modem connection, etc). Christopher Thompson wrote: > Read the manual. MySQL doesn't support subselects but offers you > alternatives.

Re: subselect query

2002-04-15 Thread Christopher Thompson
Read the manual. MySQL doesn't support subselects but offers you alternatives. On Monday 15 April 2002 2:45 pm, Jeff Shipman wrote: > I'm trying to do a fairly simple select of a > column from a table where the date of that column > happens to be the highest value. I tried this: > > SELECT name

subselect query

2002-04-15 Thread Jeff Shipman
I'm trying to do a fairly simple select of a column from a table where the date of that column happens to be the highest value. I tried this: SELECT name FROM products WHERE prod_type='foo' AND added=(SELECT MAX(added) FROM products WHERE prod_type='foo'); But I get the error: ERROR 1064: You h