Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6670253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:14:47+00:00 2026-05-26T03:14:47+00:00

I have a MySQL table in which one of the fields is variation and

  • 0

enter image description hereI have a MySQL table in which one of the fields is variation and type is float. Its value is 0.2. But when I query like WHERE variation = '0.2' it is not showing the result, instead it returns null. What I am doing wrong?

SELECT * FROM tbl_products
  WHERE frequency BETWEEN '2' AND '3'
    AND gain = '2'
    AND gain_variation = '0.2'
    AND noise = '2'
    AND power = '10'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:14:48+00:00Added an answer on May 26, 2026 at 3:14 am

    Remove the quotes around the number a try again.

    eg WHERE variation = 0.2

    Edit: As Peeka pointed out, the quotes don’t matter in MySQL.

    Are you absolutely sure the value of the float is exactly 0.2 and there aren’t significant digits that are getting rounded? Can you try using BETWEEN 0.19 AND 0.21 and seeing whether the row you’re after gets returned (I know it’s not an equivalent query and may return unwanted results but it will test whether the value is exactly 0.2 or whether it’s rounded in the client).

    Edit 2: I’d wager it’s because of the way MySQL stores floats – taken from their manual:

    Floating-point numbers sometimes cause confusion because they are approximate and not stored as exact values. A floating-point value as written in an SQL statement may not be the same as the value represented internally.

    See here for more info: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html

    It is recommended to use a range to filter instead of an equality, so if you use BETWEEN 0.19 AND 0.21 do you get the result you want?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this mysql table called comments which looks like this: commentID parentID type
I have mysql table called it as R which contains many fields, but I
i have a large mysql database table in which one column contains values ranging
I have a classified_id variable which matches one document in a MySql table. I
I have a huge MySQL table which has its rows encoded in UTF-8 twice.
I have a mysql table field set as time type which stores data in
I have a main MySQL table which holds products. Any multiple fields for each
I have a MySQL insert query which needs to pull one data field from
I have a MySQL table of names , which consists of two fields: name
I have 2 fields in one mysql table. One field has full sentence and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.