Hi, I'd like to know how I can do the following:
I want to query a single table like this: select field1, field2, field3 from table1 where field1='something' and field2=0; This query will result in more then one match. It's not possible for me to use a more specific query. From the result I only need the first hit. All the other rows are not important. (e.g. I get 100 rows back, but I only need 1) So my question: How can I stop the query on the first match and return the result of that match and prevent the query from fetching all matching records (and limit the results afterwards by using LIMIT 1). This is mainly for boosting the performance of mys queries. Actually where using mysql to dynamically assign ip addresses to our dial-in users. We query the database for available addresses -> there are more than 1 available but I only need 1! Thanks in advance! Danny Kruitbosch --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php