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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:35:18+00:00 2026-05-20T09:35:18+00:00

SELECT COUNT(*) FROM area WHERE ROUND(SQRT(POWER((’71’ – coords_x), 2) + POWER((’97’ – coords_y), 2)))

  • 0
SELECT COUNT(*) FROM area
WHERE ROUND(SQRT(POWER(('71' - coords_x), 2) +
                 POWER(('97' - coords_y), 2))) <= 17

==> 51

SELECT COUNT(*) FROM area
WHERE ROUND(SQRT(POWER((71 - coords_x), 2) +
                 POWER((97 - coords_y), 2))) <= 17

==> 22

coords_x and coords_y are both TINYINT fields containing values in the range [1, 150]. Usually MySQL doesn’t care if numbers are quoted or not.. but apparently it does in this case.

The question is just: Why?

  • 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-20T09:35:18+00:00Added an answer on May 20, 2026 at 9:35 am

    MySQL always cares about data types. What happens is that your code relies in automatic type casting and performs math on strings (which can hold a number or not). This can lead to all sort of unpredictable results:

    SELECT POW('Hello', 'World') -- This returns 1
    

    To sum up: you need to learn and use the different data types MySQL offers. Otherwise, your application will never do reliable calculations.

    Update:

    One more hint:

    TINYINT[(M)] [UNSIGNED] [ZEROFILL]

    A very small integer. The signed range
    is -128 to 127. The unsigned range is
    0 to 255.

    URL:
    http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html

    I hope you are not trying to store 150 in a signed tinyint column.

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

Sidebar

Related Questions

TOPIC_COUNT_SQL = SELECT COUNT(*) FROM topics_topic WHERE topics_topic.object_id = maps_map.id AND topics_topic.content_type_id = %s
When we execute select count(*) from table_name it returns the number of rows. What
I have this query: SELECT COUNT(articles.id) AS count FROM articles, xml_documents, streams WHERE articles.xml_document_id
I'm trying to do a simple Select Count(*) from PRODUCTS where date > xxx
When I run the query : select count(*) from (select idCover from x90..dimCover group
I have the following two queries: select count(*) from segmentation_cycle_recipients scr , segmentation_instance si
I have the following query: SELECT COUNT(*) FROM FirstTable ft INNER JOIN SecondTable st
mysql> select count(*) from table where relation_title='xxxxxxxxx'; +----------+ | count(*) | +----------+ | 1291958
$count_sql = preg_replace(/SELECT(.+?)FROM/, SELECT COUNT(*) FROM, $sql); It's probably pretty obvious what I'm trying
How do I formulate this query update forge..dimInteg2 set duplicates = (select count(*) from

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.