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:
@@ -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
|
||||
|
||||
19
mysql/show-tables-that-match-a-pattern.md
Normal file
19
mysql/show-tables-that-match-a-pattern.md
Normal 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 |
|
||||
+-------------------------------+
|
||||
```
|
||||
Reference in New Issue
Block a user