[vox-tech] puzzling over MySQL query: joining aggregated values in a single query

2006-04-11 Thread Dylan Beaudette
Hi! I have a simple table with multiple records per id number: soil horizons from numerous pits. the top and bottom of each horizon or layer is defined in the fields 'top' and 'bottom' a quick example of a single pit's records would like like this:

Re: [vox-tech] puzzling over MySQL query: joining aggregated values in a single query

2006-04-11 Thread Chris Jenks
On Tue, 11 Apr 2006, Dylan Beaudette wrote: [...] I am able to select out the soil depth, excluding certain horizons with the following query: select pedon_id, max(bottom) as depth from horizon where name REGEXP '.?C.?| R|.b.?' != 1 group by pedon_id ; a simple result for the above example