I have a 'range' of integers (in this case destination ports) that occur:
For example: 33848-33254.
I want to select 'all' of these without having to do one at a time. is there a range operator? Or should I just use 'between'?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
You can use
BETWEEN or greater than/less than operators:
select * from yourtable where col1 >= 33254 and col1 <= 33848;
select * from yourtable where col1 between 33254 and 33848;
BETWEEN is your friend, as in
SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2