Solved

Show tables NOT like

Posted on 2006-06-24
3
1,126 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mcrypt_create_iv() is deprecated 4 422
How many transactions can mysql handle? 3 60
running code or pseudo code of table structure 5 36
MySQL - need to join three tables 2 54
Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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