SQLTeam.com | Weblogs | Forums

Need some Basic SQL Help for selecting a range


#1

Good Morning,

This is my first post so hopefully I'm doing it right.

I need to remove a group of lines so from 10 to 50, at the moment I'm doing it line by line or have to enter each line number and add a ,

See example:

DELETE FROM TRNLN
WHERE TID = '1003004';

DELETE FROM TRNLN
WHERE TID in (3046856,3046857,3046858,3046859,3046860,3046861,3046862);

I cant work out how to do something like:

DELETE FROM TRNLN
WHERE TID in (10190 to 10200);

Thanks you in advance for any help on this as I've got hundreds of lines to remove.


#2

Finery worked it out my self.

Thanks for all the input, I wont be back.


#3

I guess you did something like this?

DELETE FROM TRNLN
WHERE TID >= 10190
AND TID <= 10200

Sorry no one got back to you in time, this forum can be a bit busy.


#4

I think you were looking for BETWEEN.

8 days ago you posted this? I've reviewed several times and did not see this post.