LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2005, 11:47 AM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
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
 
Old 02-07-2005, 04:17 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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;
 
Old 02-07-2005, 07:23 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
get ip range. bruse Linux - Wireless Networking 2 08-23-2005 07:37 AM
Out of range peterx1 Red Hat 1 09-17-2004 11:23 AM
Out of range Elyubarov Linux - Hardware 1 08-12-2004 08:49 PM
out of range... Rowsdower11 Red Hat 6 11-17-2003 12:39 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration