Re: Yet another query question

2010-07-26 Thread Michael Stroh
Yes, sorry, you are correct. I am actually grouping on that other column. I'll take a look at this and see if it works for me. Thanks! Michael On Jul 26, 2010, at 6:10 PM, Geert-Jan Brits wrote: > Aren't you grouping on IDt? > > something like ? : > select t2.IDt,t2.ID,t2.Num,max(t2.version)

Re: Yet another query question

2010-07-26 Thread Geert-Jan Brits
Aren't you grouping on IDt? something like ? : select t2.IDt,t2.ID,t2.Num,max(t2.version) from table1 as t1, tabl2 as t2 where t1.num=t2.num and t1.state!='new' group by t2.IDt Cheers, Geert-Jan 2010/7/26 Michael Stroh > Hi everyone and thanks in advance for the help. I have a query that I'd >

RE: Yet another query question

2010-07-26 Thread Gavin Towey
You'll need to use the technique described here: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html -Original Message- From: Michael Stroh [mailto:st...@astroh.org] Sent: Monday, July 26, 2010 2:50 PM To: MySql Subject: Yet another query question Hi eve

Yet another query question

2010-07-26 Thread Michael Stroh
Hi everyone and thanks in advance for the help. I have a query that I'd like to perform using two tables but am not sure what the best way to perform it short of creating a loop in my code and performing multiple queries. I have two tables. The first table acts as a master table of sorts and Num

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread Mark Phillips
Thanks to everyone for their help. Using Nigel's suggestion, I was able to gather all the summary data in one query. Those nested if()'s are really useful! FWIW, you can see the summary stats at http://rockets.phillipsoasis.com Just click on Hopi Rockets and scroll to the bottom of the page. My

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread Mark Phillips
Nigel, Again, thanks - that is the "rule of thumb" I was looking for! Mark On Wednesday 14 December 2005 09:57 am, nigel wood wrote: > Mark Phillips wrote: > >2. Generally, what is the most "efficient" way to do this? Is is better to > >issue more queries that gather the "calculated data" or bet

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread Mark Phillips
Nigel, Thanks! Mark On Wednesday 14 December 2005 09:42 am, nigel wood wrote: > Mark Phillips wrote: > >Flights > >+---+--+--+ > > > >| flight_id | data1_id | data2_id | > > > >+---+--+--+ > > > >| 1 |1 |1 | > >| 2 |

RE: YAQQ (Yet Another Query Question)

2005-12-14 Thread Peter Lauri
PM To: MYSQL List Subject: YAQQ (Yet Another Query Question) I am using MySQL 4.0.x on a Linux machine with a JSP/Servlet front-end to display the data. I have a table with experimental data for each flight of a rocket. Conceptually, it looks like (with many more columns): Flights

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread SGreen
Mark Phillips <[EMAIL PROTECTED]> wrote on 12/14/2005 11:31:03 AM: > I am using MySQL 4.0.x on a Linux machine with a JSP/Servlet front-end to > display the data. > > I have a table with experimental data for each flight of a rocket. > Conceptually, it looks like (with many more columns): >

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread nigel wood
Mark Phillips wrote: 2. Generally, what is the most "efficient" way to do this? Is is better to issue more queries that gather the "calculated data" or better to issue one query for the raw data and then do the calculations in Java? I am sure there are many factors that effect the answer to

Re: YAQQ (Yet Another Query Question)

2005-12-14 Thread nigel wood
Mark Phillips wrote: Flights +---+--+--+ | flight_id | data1_id | data2_id | +---+--+--+ | 1 |1 |1 | | 2 |1 |3 | | 3 |1 |1 | | 4 |2 |2 | | 5 |

YAQQ (Yet Another Query Question)

2005-12-14 Thread Mark Phillips
I am using MySQL 4.0.x on a Linux machine with a JSP/Servlet front-end to display the data. I have a table with experimental data for each flight of a rocket. Conceptually, it looks like (with many more columns): Flights +---+--+--+ | flight_id | data1_id | data2_id | +-