Re: range question for db query

From: Date: Wed, 13 Dec 2000 05:29:04 +0000
Subject: Re: range question for db query
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30026@lists.php.net to get a copy of this message
On Wed, 13 Dec 2000, Jon Rosenberg wrote: > if i have a column in mysql that holds an age, and I want to send a query to > mysql that says retrieve the record if age is between 10 and 20, how do I > construct that query and use it with other search options, also..like below? > > select * from table where age = (>9 and <21) and sex = male..etc > > Thanks! > > Jon To answer your specific question: select * from table where (age >9 and age <21) and sex = 'male' ..etc And may I recommend to you a SQL tutorial from http://www.willcam.com/sql/default.htm -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#30026) next »