Re: it works but is this right

2002-06-11 Thread Todd Wade
A Taylor wrote: > howdy all, > I was wondering if you could help me, I have a perl script that executes a > SQL statement: > > 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' > > This returns many records but all i am interested in is the highest rank > hence the 'ORDER BY prop_rank DESC'.

Re: it works but is this right

2002-06-11 Thread A Taylor
thanks everyone - a lot of help and I have learned loads ;-) >SELECT MAX(prop_rank)... >"A Taylor" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > howdy all, > > I was wondering if you could help me, I have a perl script that executes >a > > SQL statement:

Re: it works but is this right

2002-06-11 Thread Michael Fowler
On Tue, Jun 11, 2002 at 05:49:53PM +, A Taylor wrote: > 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' > > This returns many records but all i am interested in is the highest rank > hence the 'ORDER BY prop_rank DESC'. > I then retreive the highest rank like so: > > $rank = $sth1->fet

Re: it works but is this right

2002-06-11 Thread Dave K
Uh,... no (atleast IMHO) SELECT MAX(prop_rank)... would be a more efficient approach HTH "A Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > howdy all, > I was wondering if you could help me, I have a perl script that executes a > SQL statement: > > 'SELE

Re: it works but is this right

2002-06-11 Thread Christopher Solomon
On Tue, 11 Jun 2002, A Taylor wrote: > > $rank = $sth1->fetchrow_array(); > > Now, my question is this: is this the right way to retreive just 1 record, > using fetchrow_array(); ??? or is there a more acceptable way. This does > work, its just the 'array()' part is making me a little uneasy. >

it works but is this right

2002-06-11 Thread A Taylor
howdy all, I was wondering if you could help me, I have a perl script that executes a SQL statement: 'SELECT prop_rank FROM main ORDER BY prop_rank DESC' This returns many records but all i am interested in is the highest rank hence the 'ORDER BY prop_rank DESC'. I then retreive the highest ra