PostgreSQL Delete records...

Posted on 2010-01-03
Last Modified: 2012-05-08
Dear Experts,

I have a table that contains all the members I want to delete from my database using the userIDs as the identifier. I need a SQL operation that will take all the userID from the table deleteusers and delete all the corresponding records from another table called allusers that has a corresponding userID.

Question by:Joel_Sisko
    LVL 30

    Accepted Solution

    delete from allusers
    where userID in
    select userID from deleteusers
    LVL 12

    Author Comment

    Awesome thanks.
    LVL 30

    Expert Comment

    by:Reza Rad
    Glad to help,


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Left Justify field in Oracle 6 53
    Getting from database to make one row 17 39
    Format Number Field 10 34
    SQL Query 18 64
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now