1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00

Add Show Tables That Match A Pattern as a mysql til

This commit is contained in:
jbranchaud
2017-06-10 09:31:37 -05:00
parent 3d6cfe3e89
commit eab940567c
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
# Show Tables That Match A Pattern
An unfamiliar database with tons of tables can be a difficult thing to
navigate. You may have an idea of the kind of table you are looking for
based on a domain concept you've seen elsewhere.
You can pare down the results returned by `show tables` by including a
`like` clause with a pattern. For example, this statement will show me only
tables that have the word `user` in them:
```sql
> show tables like '%user%';
+-------------------------------+
| Tables_in_jbranchaud (%user%) |
+-------------------------------+
| admin_users |
| users |
+-------------------------------+
```