1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08: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

@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
For a steady stream of TILs from a variety of rocketeers, checkout
[til.hashrocket.com](https://til.hashrocket.com/).
_539 TILs and counting..._
_540 TILs and counting..._
---
@@ -235,6 +235,7 @@ _539 TILs and counting..._
- [Display Output In A Vertical Format](mysql/display-output-in-a-vertical-format.md)
- [Dump A Database To A File](mysql/dump-a-database-to-a-file.md)
- [List Databases And Tables](mysql/list-databases-and-tables.md)
- [Show Tables That Match A Pattern](mysql/show-tables-that-match-a-pattern.md)
- [Show Indexes For A Table](mysql/show-indexes-for-a-table.md)
### Phoenix

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 |
+-------------------------------+
```