473,396 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

mysql query result error!

pradeepjain
563 512MB
Expand|Select|Wrap|Line Numbers
  1. mysql> select property1,property2,property3,property4 from mobiles where (property4 >= '2000' and property4 < '5000') ;
  2. +---------------+-----------+-----------+-----------+
  3. | property1     | property2 | property3 | property4 |
  4. +---------------+-----------+-----------+-----------+
  5. | Motorola      | M2222     | Music     | 3500      | 
  6. | Motorola      | W7        | Pda       | 22000     | 
  7. | Nokia         | 3110c     | Camera    | 2100      | 
  8. | Nokia         | N97       | Smart     | 25000     | 
  9. | Nokia         | N97 mini  | Music     | 29000     | 
  10. | Nokia         | X3        | Music     | 24000     | 
  11. | Nokia         | X6        | Music     | 21000     | 
  12. | Sony Erricson | G502      | Music     | 4000      | 
  13. +---------------+-----------+-----------+-----------+
  14. 8 rows in set (0.00 sec)
as you can see in the mysql query i am trying to find things b/w range 2000-5000, but things above 5000 are also getting displayed dono the reason . any help on this.
Dec 15 '09 #1
3 1572
mwasif
802 Expert 512MB
Make sure you have the right data type for column property4. It should be INT, BIGINT or DOUBLE.
Dec 15 '09 #2
pradeepjain
563 512MB
yeah okie... i changed it to INT now its working,earlier it was varchar , y will it give problem when its varchar ?
Dec 15 '09 #3
nbiswas
149 100+
What is the data type of the Property4? Is it integer/numeric?

If that is supposed to be the case then don't put that in quotes

So instead of

select property1,property2,property3,property4 from mobiles where (property4 >= '2000' and property4 < '5000') ;

try

Expand|Select|Wrap|Line Numbers
  1. select property1,property2,property3,property4 from mobiles where (property4 >= 2000 and property4 < 5000) ;
Also take the help of between... and operator

Expand|Select|Wrap|Line Numbers
  1. select property1,property2,property3,property4 from mobiles where (property4 between  2000 and 5000) ;
hope this helps
Dec 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
4
by: Bob Bedford | last post by:
We have no access to a mysql NG on my provider's server, so we ask here: We have a long query (long in text) with a UNION between 2 select. We have been informed that some times the query...
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
15
by: harvey | last post by:
How do I make PHP create a database for mysql please? I can see how to make tables and I have read all the documents I can find but I don't understand how to make the database itself. All...
21
by: bruno_guedesav | last post by:
I've made a function to fetch all results as an array of result- arrays. Getting the result arrays is easy, via mysql_fetch_array, and function itself is quite simple, as follows: function...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
10
by: Caffeneide | last post by:
I'm using a php script which performs three xml queries to other three servers to retrieve a set of ids and after I do a query to mysql of the kind SELECT * FROM table WHERE id IN ('set of ids');...
3
by: thesmithman | last post by:
Well, actually, I'm sure it's my code... I have a basic nested query: $query="INSERT INTO items (blah, blah, blah) VALUES ('$blah', '$blahblah', NULL)"; $result=mysql_query($query) or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.