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 6214925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:57:45+00:00 2026-05-24T06:57:45+00:00

I have the following sql query in mysql: SELECT * FROM _t_test WHERE pret

  • 0

I have the following sql query in mysql:

SELECT * 
FROM _t_test
WHERE pret NOT 
IN ( 2.6700, 2.6560, 1.8200 ) 

I would expect the rows with the value 1.8200 not to be shown, yet I still get them.
Am I missing something?
The field “pret” is double(16,4).

  • 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-24T06:57:46+00:00Added an answer on May 24, 2026 at 6:57 am

    This is a rounding error. A double is not an exact value, so 1.8200 isn’t represented exactly, so the values are not exactly the same.

    For MYSQL floating points, see http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html

    The correct way to do floating-point number comparison is to first
    decide on an acceptable tolerance for differences between the numbers
    and then do the comparison against the tolerance value. For example,
    if we agree that floating-point numbers should be regarded the same if
    they are same within a precision of one in ten thousand (0.0001), the
    comparison should be written to find differences larger than the
    tolerance value

    See http://en.wikipedia.org/wiki/Double_precision_floating-point_format

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

Sidebar

Related Questions

I have the following SQL query: select expr1, operator, expr2, count(*) as c from
I have a following SQL QUERY: SELECT articles.name, articles.price, users.zipcode FROM articles INNER JOIN
I have the following which works in SQL Query Analyzer . select oh.* from
I have the following SQL query: SELECT DISTINCT business_key FROM Memory WHERE concept <>
I have a SQL query as follows SELECT * FROM epf_application WHERE application_id IN
I have the following SQL statement: mysql_query(SELECT * FROM `friends` WHERE friend1='$username' OR friend2='$username'
I have two tables in my SQL database: mysql> select *from crop; +------+-----------+----------+ |
Following query runs well in MySQL 5.x SELECT m_area.id, m_area.cn_areaName, m_area.de_areaName, m_area.en_areaName,m_area.jp_areaName,t_shop.count FROM m_area
So I have the following query: IF ( ( SELECT RevisionNumber FROM SchemaVersion )
I have the following sql query for transforming data but is it possible to

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.