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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:54:45+00:00 2026-05-26T07:54:45+00:00

I want to compare some floating values . To do,my query is like :

  • 0

I want to compare some floating values . To do,my query is like :

SELECT * FROM pricelist WHERE START_FREQUENCY >= '(
    SELECT START_FREQUENCY
    FROM pricelist
    WHERE START_FREQUENCY BETWEEN '0.49999' AND '0.50001'
)' AND STOP_FREQUENCY <= '(
    SELECT STOP_FREQUENCY
    FROM pricelist
    WHERE STOP_FREQUENCY BETWEEN '0.59999' AND '0.60001'
)'

But in my PHP it is showing ‘Unable to execute query’ . Where I am doing wrong ? Please help

EDIT :

I have a table where there is two fields ,START_FREQUENCY and STOP_FREQUENCY . I am trying to extract the all the values with that comes within frequency range . For example say

  START_FREQUENCY STOP_FREQUENCY
1            0.4            0.9
2            0.5            1.4
3            0.8            1.9

When the user enter start frequency = 0.4 and stop frequency = 1.9 he should get results of Row1, Row2 and Row3.

  • 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-26T07:54:45+00:00Added an answer on May 26, 2026 at 7:54 am

    Your inner SELECTs shouldn’t be quoted. Try this:

    SELECT * FROM pricelist WHERE START_FREQUENCY >= (
        SELECT START_FREQUENCY
        FROM pricelist
        WHERE START_FREQUENCY BETWEEN 0.49999 AND 0.50001
    ) AND STOP_FREQUENCY <= (
        SELECT STOP_FREQUENCY
        FROM pricelist
        WHERE STOP_FREQUENCY BETWEEN 0.59999 AND 0.60001
    )
    

    I also removed the quotes around your numbers; MySQL will convert them to numbers behind your back but there’s no need to make the database guess and do more work.

    Your version has this structure:

    SELECT *
    FROM pricelist
    WHERE START_FREQUENCY >= '...'0.49999' AND '0.50001'...'
      AND STOP_FREQUENCY  <= '...'0.59999' AND '0.60001'...'
    

    And 'string'0.49999' isn’t valid.


    Update: Sounds like you’re just overcomplicating this. I think you just want this (using your 0.4 and 1.9):

    select *
    from pricelist
    where START_FREQUENCY >= 0.4
      and STOP_FREQUENCY  <= 1.9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to compare and select a field from DB using Like keyword or
I want compare time of execution Post.all and SELECT * FROM posts (or some
I want to compare the value of the input from a UITextfield to some
I have some problem to compare values from different array list From this values,
I want to compare records between 2 databases on my SQL 2008 Server. The
I want to compare two arrays, one coming from a shoppingcart and the other
i want to compare xml document. some are 50k+. i'm comparing the OuterXml. is
I want to compare 2 directory stuctures (only files), so first I'll get some
I would like to compare two dates in javascript. I have been doing some
I'd like to compare some templating engines that supports creating RESTful URLS for templating

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.