SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Delete selected id

    I got for example this :
    id url status
    1 google.com down
    2 ask.com up
    3 monkey.nl 404
    4 noob.com up
    5 hello.com down

    How would I for example delete all sites that got the status down?
    or 404?
    So I wanna keep all up sites the rest gone, or the ones with 404 gone or ones with down gone.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by cruelity93 View Post
    How would I for example delete all sites that got the status down?
    or 404?
    Code:
    DELETE
      FROM daTable
     WHERE status IN ( 'down' , '404' )
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks!

    all my dead shells gone


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
  •