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

  • Home
  • SEARCH
  • 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 9125665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:51:23+00:00 2026-06-17T06:51:23+00:00

In my database table there are two fields named salary_to and salary_from.Now in front

  • 0

In my database table there are two fields named salary_to and salary_from.Now in front end of my website user can enter a salary in an input field say 20000.Now i wanna perform a check in the database that if any row have salaryto and salaryfrom between which the value ‘20000’ lies.
My desired algo looks like something like this

 SELECT all ROW where salaryto is less than 20000 and salaryfrom is greater than 20000

Can i use the between operator to perform this kind of filterring or i just ave to use >,< operator to this?
Provided that I’m using mysql database for my project.

  • 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-06-17T06:51:24+00:00Added an answer on June 17, 2026 at 6:51 am

    The between operator is INCLUSIVE meaning it includes the START and END Value. While < > are exclusive.

    SELECT *
    FROM  tableName
    WHERE salaryto < 20000 and salaryfrom > 20000
    

    So the rows that are fetched here are with salaryto value of 19999 and below AND salaryfrom value of 20001 and above, assuming that it increases by 1.

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

Sidebar

Related Questions

I am retriving data from database.TableName:Contacts. There are two fields of this table.First_Name and
I have a database table named 'student' in which there is one column named
is there a standard or best practice with database table names and fields in
I have a table in database in which there is a column named roll_no,
I have two tables that I'm querying from. In one table, there are fields
I have ten fields in my table in database..And two columns out of them
There is a mysql database named: example which has a table named: products it
I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields
One doubt in MSSQL. There are two tables in a databases. Table 1 named
Say I have a database called Poll and have these two table structures. poll

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.