LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PostgreSQL - deleting a range. (https://www.linuxquestions.org/questions/programming-9/postgresql-deleting-a-range-287331/)

djgerbavore 02-07-2005 11:47 AM

PostgreSQL - deleting a range.
 
hey,


i'm trying to delete a range of rows in PostgreSQL.

i've tried using various commands but not of them work. Is there a way to delete a range or do i have to make a script that generates every delete statement invidiuvally....




thanks,
djgerbavor3

Mara 02-07-2005 04:17 PM

If you want to delete a range it means you have a criteria. You can use WHERE in DELETE exactly as in SELECT. So, for example
DELETE FROM table WHERE field > value1 AND field < value2;

Tinkster 02-07-2005 07:23 PM

In addition to mara's suggestion you could have a look at
where EXP1 between EXP2 and EXP3
or
where EXP1 in (EXP2, EXP3, .... )



Cheers,
Tink


All times are GMT -5. The time now is 09:04 AM.