Re:MySql number/string comparing ideas...

From: Date: Fri, 13 Jul 2001 13:34:15 +0000
Subject: Re:MySql number/string comparing ideas...
Groups: php.general 
Request: Send a blank email to php-general+get-57728@lists.php.net to get a copy of this message
Hi, I strongly suggest to change the table columns if you can. You should add a column like valuex int and valuey int than the select would be very simple: SELECT value from table WHERE valuex <500 and valuey<100. If you can't change the stucture of the table try playing with String functions in MYSQL to obtain the two numbers 500 and 100 from '500x100'. (http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#St ring_functions) Also don't forget that String comparation is different than comparing numbers: '1500X1200' is < than '500x100' and also '1500'<'500' "elias" <elias_bachaalany@yahoo.com> wrote in message news:20010713131110.72721.qmail@pb1.pair.com... > Hi! > > How is it possible to do a MySql query for something like: > > SELECT value from table WHERE value < '500x100' > > should return all values that part1 must be less than 500 and part2 less > than 100? like 499x99 and reject something like: 500x101 > > please give me suggestions! > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#57728) next »