473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

>,<,= or BETWEEN

What is the real difference between:

1. SELECT something1 FROM something2 WHERE Value >= 1 AND Value <= 1000

2. SELECT something1 FROM something2 WHERE Value BETWEEN 1 AND 1000

In what way 2. is better than 1.?

Thanks in advance

Marek Kotowski
Warsaw
Nov 12 '05 #1
3 1428

"Marek Kotowski" <Ma************@wsip.com.pl> wrote in message
news:e5**************************@posting.google.c om...
What is the real difference between:

1. SELECT something1 FROM something2 WHERE Value >= 1 AND Value <= 1000

2. SELECT something1 FROM something2 WHERE Value BETWEEN 1 AND 1000

In what way 2. is better than 1.?


Less typing (usually).
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2
I found that when you use BETWEEN it doesn't matter which of the two values
is first and which is second.
BETWEEN 1 AND 100 gives the same result as
BETWEEN 100 AND 1

(I tested this with dates, I think it would be the same for other data
types.)

Don't know which code runs faster.
If you have a large table to test on, you might find a difference.
If your table doesn't show a difference, then - both ways are fast!

Bruce Pick

"Marek Kotowski" <Ma************@wsip.com.pl> wrote in message
news:e5**************************@posting.google.c om...
What is the real difference between:

1. SELECT something1 FROM something2 WHERE Value >= 1 AND Value <= 1000

2. SELECT something1 FROM something2 WHERE Value BETWEEN 1 AND 1000

In what way 2. is better than 1.?

Thanks in advance

Marek Kotowski
Warsaw

Nov 12 '05 #3
"Bruce Pick" <br********@comcast.net> wrote in message news:<9P********************@comcast.com>...
I found that when you use BETWEEN it doesn't matter which of the two values
is first and which is second.
BETWEEN 1 AND 100 gives the same result as
BETWEEN 100 AND 1

(I tested this with dates, I think it would be the same for other data
types.)


In MySQL it doesn't work (with dates).

Marek Kotowski
Warsaw
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
8
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a...
0
by: Wolfgang Schwanke | last post by:
Dear usenet, I'm having the following small problem. I've been ask to add some Quicktime panoramas to a website. The author of the panoramas has made two versions of each: One in MOV format,...
129
by: Torbjørn Pettersen | last post by:
I've started cleaning up my HTML and implementing CSS. So far I've used FrontPage, but am switching over to DreamWeaver. Reading a bit on W3Schools.com and W3.org I see there are a lot of HTML...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
4
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt;...
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.