RE: Selecting the row with largest number in a column

2002-01-28 Thread Butch Bean
Richard, I use this with all kinds of situations. I am using this function and others like it on tables with 100k to 3m records. They always work best when the field your looking for info on is indexed. Order By only causes a second process that seems unnecessary but I have not tested it

RE: Selecting the row with largest number in a column

2002-01-28 Thread Paul DuBois
At 10:06 -0500 1/28/02, Butch Bean wrote: Richard, I use this with all kinds of situations. I am using this function and others like it on tables with 100k to 3m records. They always work best when the field your looking for info on is indexed. Order By only causes a second process that seems

RE: Selecting the row with largest number in a column

2002-01-28 Thread Butch Bean
You are correct... my apologies, I was thinking in VB where I built a handler to let me sent multiple sql statements in one chunk and where the '@' doesn't matter. BB -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Monday, January 28, 2002 11:28 AM To: [EMAIL

RE: Selecting the row with largest number in a column

2002-01-28 Thread Butch Bean
You are correct... my apologies, I was thinking in VB where I built a handler to let me sent multiple sql statements in one chunk and where the '@' doesn't matter. BB This Works as a test... my $getbigage = $dbh-prepare( SELECT \@maxage:=max(age) from contacts); my $getbigage1

RE: Selecting the row with largest number in a column

2002-01-27 Thread Richard Morton
Thanks, but using SELECT MAX(age) FROM contacts only gives me the maximum age, not the person with that age. The table is tiny, changes very often and therefore indexes would be a waste of time. Thanks Richard -Original Message- From: Butch Bean [mailto:[EMAIL PROTECTED]] Sent: 25

Re: Selecting the row with largest number in a column

2002-01-25 Thread Joseph Bueno
Richard Morton a écrit : Hello, I have a simple query, and a problem countless people must have had, I just cannot work it out at the moment, I am new to MySQL; I hope you can help. My current statement looking at the manual. SELECT * FROM contacts WHERE age=MAX(age); I started

Re: Selecting the row with largest number in a column

2002-01-25 Thread DL Neil
Hello Richard, I have a simple query, and a problem countless people must have had, I just cannot work it out at the moment, I am new to MySQL; I hope you can help. My current statement looking at the manual. SELECT * FROM contacts WHERE age=MAX(age); I started with: mysql select *

Re: Selecting the row with largest number in a column

2002-01-25 Thread Paul DuBois
At 17:13 + 1/26/02, DL Neil wrote: Hello Richard, I have a simple query, and a problem countless people must have had, I just cannot work it out at the moment, I am new to MySQL; I hope you can help. My current statement looking at the manual. SELECT * FROM contacts WHERE

RE: Selecting the row with largest number in a column

2002-01-25 Thread Butch Bean
The fastest way I found would be: SELECT MAX(age) FROM contacts good luck bb -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 26, 2002 12:14 PM To: Richard Morton; [EMAIL PROTECTED] Subject: Re: Selecting the row with largest number in a column