SELECT'ing only 1st matching row

2001-12-13 Thread Steve Osborne
Is there a way to SELECT only the first matching row of a query? I would like to allow the registration of identical products (unique serial numbers / owned by one user), without the user having to re-enter all their data. I've set up a page that allows them to just enter their login info

RE: SELECT'ing only 1st matching row

2001-12-13 Thread Ron Jamison
Tack on a LIMIT 1 on the end of your query to limit the returned rows to 1. Reference: http://www.mysql.com/doc/S/E/SELECT.html -Original Message- From: Steve Osborne [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 12:47 PM To: MySQL (E-mail) Subject: SELECT'ing only 1st

Re: SELECT'ing only 1st matching row

2001-12-13 Thread Shakeel Sorathia
I believe what you want is to put a limit clause at the end of your sql query. ie Select Limit 1 That will only return one record that matches your query. hope this helps... --shak Steve Osborne wrote: Is there a way to SELECT only the first matching row of a query? I would like to

Re: SELECT'ing only 1st matching row

2001-12-13 Thread rc
Would you not want to display the last preferences they submitted? In this case, if you have a timestamp field for each record you could select last(timestamp) where userid = idvaluefromform. On Thu, 13 Dec 2001, Steve Osborne wrote: Is there a way to SELECT only the first matching row

Re: SELECT'ing only 1st matching row

2001-12-13 Thread Steve Osborne
: SELECT'ing only 1st matching row Tack on a LIMIT 1 on the end of your query to limit the returned rows to 1. Reference: http://www.mysql.com/doc/S/E/SELECT.html -Original Message- From: Steve Osborne [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 12:47 PM To: MySQL

Re: SELECT'ing only 1st matching row

2001-12-13 Thread sherzodR
SELECT * FORM table_name WHERE ID IS NULL LIMIT 1; Steve Osborne wrote: SO: Date: Thu, 13 Dec 2001 12:47:26 -0800 SO: From: Steve Osborne [EMAIL PROTECTED] SO: To: MySQL (E-mail) [EMAIL PROTECTED] SO: Subject: SELECT'ing only 1st matching row SO: SO: Is there a way

Re: SELECT'ing only 1st matching row

2001-12-13 Thread Etienne Marcotte
/E/SELECT.html -Original Message- From: Steve Osborne [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 12:47 PM To: MySQL (E-mail) Subject: SELECT'ing only 1st matching row Is there a way to SELECT only the first matching row of a query? I would like to allow