Solved

Show tables NOT like

Posted on 2006-06-24
3
1,119 Views
Last Modified: 2008-01-09
ok

I'm NOT using MySQL 5

I need to exclude 1 table from a list of about 50. to get my list I'm using "show tables DBNAME"

when I tried the 'not like' it didn't work (if i use ust like then it does show the table I'm trying to exclude)

Can I use like 'table1' OR like 'table2' ??

any ideas ?

TIA
0
Comment
Question by:abenbow
3 Comments
 

Author Comment

by:abenbow
ID: 16974913
OR LIKE doesn't work
0
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 16977016
show tables will not support 'not like' syntax. You can use the information schema, which holds a list of all the user tables

SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'DBNAME'  and table_name != 'skip_this table;'
0
 
LVL 30

Accepted Solution

by:
todd_farmer earned 500 total points
ID: 16979827
There isn't any syntax that I am aware of that will let you show all tables but hide a specific one.  The suggestion to use INFORMATION_SCHEMA is valid - but only if you are using MySQL 5.0 (which you already said you were not).
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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