SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to drop several tables with wild card?

    drop table like 'jos%';

    is not working. You would think this would be easy but I can't find any referance to dropping several tables at once.

    Please help.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by steeleye2000 View Post
    ... I can't find any referance to dropping several tables at once.
    likely because there isn't any

    you could generate the DROP statements by running a query agains the INFORMATION_SCHEMA

    i notice you did not post in the mysql forum -- what database system are you using?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using mySQL 5.1.34 GPL

    I actually found the following:

    DROP table where table like 'jos_%';

    which worked sortof - it seemed to freeze the database and I had to go out and go back in but - it worked -those tables were gone.

    Thanks,
    Diana


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
  •