Re: help with correlated subquery

2012-08-23 Thread Larry Martell
On Thu, Aug 23, 2012 at 8:08 AM, Larry Martell wrote: > On Tue, Aug 21, 2012 at 8:26 PM, Larry Martell > wrote: >> On Tue, Aug 21, 2012 at 8:07 PM, wrote: >>> 2012/08/21 16:35 -0600, Larry Martell >>> I am trying to write a query that selects from both a correlated >>> subquery and a

Re: help with correlated subquery

2012-08-23 Thread Larry Martell
On Tue, Aug 21, 2012 at 8:26 PM, Larry Martell wrote: > On Tue, Aug 21, 2012 at 8:07 PM, wrote: >> 2012/08/21 16:35 -0600, Larry Martell >> I am trying to write a query that selects from both a correlated >> subquery and a table in the main query, and I'm having a lot of >> trouble gett

Re: help with correlated subquery

2012-08-22 Thread Shawn Green
Hello Martin, On 8/22/2012 8:30 AM, Martin Gainty wrote: assign realistic alias names OuterJoin should be called OuterJoin InnerJoin should be called InnerJoin Almost! MySQL does not have a simple OUTER JOIN command (some RDBMSes call this a FULL OUTER JOIN). What we do have is the option

RE: help with correlated subquery

2012-08-22 Thread Rick James
y.mart...@gmail.com] > Sent: Tuesday, August 21, 2012 7:27 PM > To: h...@tbbs.net > Cc: mysql@lists.mysql.com > Subject: Re: help with correlated subquery > > On Tue, Aug 21, 2012 at 8:07 PM, wrote: > >>>>> 2012/08/21 16:35 -0600, Larry Martell >>>> >

RE: help with correlated subquery

2012-08-22 Thread Martin Gainty
onné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Tue, 21 Aug 2012 20:26:51 -0600 > Subject: Re: help with correlated subquery > From: larry.mart...@gmail.com > To: h...@tbbs.net &g

Re: help with correlated subquery

2012-08-21 Thread Larry Martell
On Tue, Aug 21, 2012 at 8:07 PM, wrote: > 2012/08/21 16:35 -0600, Larry Martell > I am trying to write a query that selects from both a correlated > subquery and a table in the main query, and I'm having a lot of > trouble getting the proper row count. I'm sure this is very simple, > and

Re: help with correlated subquery

2012-08-21 Thread hsv
2012/08/21 16:35 -0600, Larry Martell I am trying to write a query that selects from both a correlated subquery and a table in the main query, and I'm having a lot of trouble getting the proper row count. I'm sure this is very simple, and I'm just missing it. I'll try and present a simple

Re: help with correlated subquery

2012-08-21 Thread Larry Martell
On Tue, Aug 21, 2012 at 5:39 PM, Martin Gainty wrote: > a look at the first query: > > select count(*), target_name_id, ep, wafer_id from data_cst > where target_name_id = 44 group by target_name_id, ep, wafer_id; > +--++--+--+ > | count(*) | target_name_id |

Re: help with correlated subquery

2012-08-21 Thread Larry Martell
On Tue, Aug 21, 2012 at 5:30 PM, Rick James wrote: > select count(*), target_name_id, ep, avg(bottom), avg(averages) > from > > ( SELECT avg(bottom) as averages, target_name_id as t, > ep as e > from data_cst > where target_name_id = 44 >

RE: help with correlated subquery

2012-08-21 Thread Rick James
select count(*), target_name_id, ep, avg(bottom), avg(averages) from ( SELECT avg(bottom) as averages, target_name_id as t, ep as e from data_cst where target_name_id = 44 group by target_name_id, ep, wafer_id) x, data_