Professional Web Applications Themes

Delete multiple rows in one go !! ?? - MySQL

This is on a PHPBB forum, but I'm looking at running this as an SQL Query if possible.. I've been validating the email addresses of my users and now want to delete some accounts based on non validated email addresses... So I have a list of address: com com com ETC... Any way to delete the users based on a list like above ?? I have about 400 email addresses.. Thanks...

  1. #1

    Default Delete multiple rows in one go !! ??

    This is on a PHPBB forum, but I'm looking at running this as an SQL
    Query if possible..

    I've been validating the email addresses of my users and now want to
    delete some accounts based on non validated email addresses...

    So I have a list of address:

    com
    com
    com

    ETC...

    Any way to delete the users based on a list like above ?? I have about
    400 email addresses..

    Thanks

    jerryyang_la1@yahoo.com Guest

  2. #2

    Default Re: Delete multiple rows in one go !! ??


    <com> wrote in message
    news:googlegroups.com... 


    How are you validating the addresses?

    I used to have a contacts list, which I would periodically check (on a
    webpage). Checkboxes were used to add a value to the "OBSOLETE" column that
    I had created.

    Then

    DELETE FROM CONTACTS WHERE OBSOLETE <> ""

    Later, I decided to keep the invalid ones and then add functionality to the
    pages that would prevent that email address from being used. So where I
    wanted a list of my contacts:

    SELECT * FROM CONTACTS WHERE OBSOLETE = ""

    Hope you can find something useful there.



    Sean Guest

  3. #3

    Default Re: Delete multiple rows in one go !! ??

    On 21 Mar, 08:56, com wrote: 

    You can put the email addresses into their own table and use a JOIN to
    drive the deletes.

    Captain Guest

  4. #4

    Default Re: Delete multiple rows in one go !! ??

    Thanks

    I've exported the email addresses into a text file, validated them and
    know have a list of known bad addresses.

    Can you explain
    "You can put the email addresses into their own table and use a JOIN
    to
    drive the deletes. "

    Or any other options ??

    Thanks

    jerryyang_la1@yahoo.com Guest

  5. #5

    Default Re: Delete multiple rows in one go !! ??

    On 21 Mar, 16:01, com wrote: 

    Suppose in your `accounts` table the email column is called `email`,
    you could put all the email addresses that you want deleted in another
    table called `bademails` and we'll call the column `emal` again.

    Then you can use the multi table delete syntax JOINing the 2 tables.

    Or of course you could change your list into the contents of an IN set.

    Captain Guest

  6. #6

    Default Re: Delete multiple rows in one go !! ??

    On 21 Mar, 16:23, "Captain Paralytic" <com> wrote: 




    >
    > Suppose in your `accounts` table the email column is called `email`,
    > you could put all the email addresses that you want deleted in another
    > table called `bademails` and we'll call the column `email` again.
    >
    > Then you can use the multi table delete syntax JOINing the 2 tables.
    >
    > Or of course you could change your list into the contents of an IN set.[/ref]

    Example of multi table delete:

    DELETE FROM `accounts` USING `accounts` JOIN `bademails` USING(`email`)

    Captain Guest

Similar Threads

  1. Delete rows out of a DG
    By 187_2007 in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: June 25th, 11:16 PM
  2. How to delete duplicate rows?
    By Clodoaldo Pinto in forum PostgreSQL / PGSQL
    Replies: 4
    Last Post: February 4th, 11:11 AM
  3. Delete multiple rows
    By Darren Carter in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: January 12th, 10:33 PM
  4. Dynamically add Delete rows
    By Dave Londeck in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 30th, 03:05 PM
  5. need help figuring out how to delete rows?
    By Deadsam in forum PHP Development
    Replies: 3
    Last Post: August 25th, 06:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139