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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:27:00+00:00 2026-05-27T21:27:00+00:00

For example: table name = table column1 | column2 1 7 2 8 3

  • 0

For example: table name = table

column1 | column2

1              7
2              8
3              9
4             NULL
5              11
6              12

A user is asked to enter two values, one from column1 and one from column 2. Lets say user enters 2 and 12. the result should look something like this.

column1 | column2

3              9
4             NULL
5              11

I have tried by using this code below but i’m not sure if it works correctly. Plus Null values are not shown so that’s a problem too. Also, actual values contain both numeric and string values.

SELECT DISTINCT column1, column2 
FROM table 
WHERE column1 
BETWEEN '&column1' AND column1 
AND column2 NOT BETWEEN '&column2 AND column2 
ORDER BY column1;

Thank you for replying

  • 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-27T21:27:01+00:00Added an answer on May 27, 2026 at 9:27 pm
    SELECT DISTINCT column1, column2 
    FROM table 
    WHERE column1 
    BETWEEN '&column1' AND (SELECT column1 FROM table WHERE column2 = '&column2') 
    ORDER BY column1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, mysql quote table name using SELECT * FROM `table_name`; notice the `
I have two tables, for example: Table A Table B ======= ======= Name |
Do you prefix each field in a table with abbreviated table name? Example: Table:
For example my table is here>> CREATE TABLE tProject( name nvarchar(1000), Goal ntext, Activities
This is my example of my table: id | name | foreign_id | -------------------------
I have a table that has (for example) 4 columns. pk_table_id INT NOT NULL
Table User contains the fields id, name, fruit, veggies, meat. Table FruitType contains the
I have two columns. when i am dividing values of both table i am
I am having a common field in ten tables with different field name. example:
Example: Table: box boxID color 01 red 02 blue 03 green Table: boxHas boxID

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.