Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 06-01-2018, 10:14 AM   #1
Pavan Techn
Registered User
 
Join Date: Mar 2018
Posts: 341
What is the difference between BETWEEN and IN condition operators?

The BETWEEN operator is used to display rows based on a range of values. The IN condition operator is used to check for values contained in a specific set of values.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Pavan Techn is offline   Reply With Quote

Old 09-03-2019, 01:48 AM   #2
henrybolt
Registered User
 
Join Date: Oct 2016
Posts: 655
Both of these operators are used to find out the multiple values from the table. Differences between these operators are that the BETWEEN operator is used to select a range of data between two values while The IN operator allows you to specify multiple values. Here we are finding the multiple values by using the SQL.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
henrybolt is offline   Reply With Quote
Old 09-03-2020, 09:25 AM   #3
Kumkum
Registered User
 
Join Date: Dec 2017
Posts: 43
Hi,
BETWEEN operator: This operator is specially used to work with numeric data. BETWEEN operator select the values from particular range of values.
Ex. SELECT column_name(s)
FROM table_name
WHERE columnname BETWEEN value1 AND value2;

IN operator: In operator is a logical operator which uses to check that particular values exists or not in set of values.
Ex.
SELECT column_list FROM table
WHERE columnname IN (values1, values2, values3...);

The main difference between these two operators are In operator allows to check specific value from multiple data and BETWEEN operator used to select multiple (range) of data.
Kumkum is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:44 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.