Hello all
I wanted to ask if there is a way of inserting some mathematics in an SQL select statement.
What I am interested in is to select all rows from a table where 56<ID<67 for example.
Thank you
Printable View
Hello all
I wanted to ask if there is a way of inserting some mathematics in an SQL select statement.
What I am interested in is to select all rows from a table where 56<ID<67 for example.
Thank you
I suggest to do some tutorials about sql. A good one can be found on w3schools.com
The part you are looking for: http://w3schools.com/sql/sql_between.asp
Yes there is a way to perform almost every kind of search using SQL, the only condition for that is you should go through some tutorials and do some practice.
SO THE TUTORIAL LINK GIVEN SHOWS YOU ...
Another way could also beCode:SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2
Code:SELECT * FROM table_name
WHERE ID > 56 AND ID < 67
The difference is thatincludes both value1 and value2, so to get the rows such that 56 < ID < 67 (that is not including 56 and 67) you need to use either George1111's alternative orCode:column_name BETWEEN value1 AND value2
Code:... WHERE ID BETWEEN 57 AND 66