mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add List All Rows In A Table as a postgres til
This commit is contained in:
32
postgres/list-all-rows-in-a-table.md
Normal file
32
postgres/list-all-rows-in-a-table.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# List All Rows In A Table
|
||||
|
||||
Perhaps the more common way to list all rows in a table is with the
|
||||
following `select` command:
|
||||
|
||||
```sql
|
||||
select * from bedding_types;
|
||||
```
|
||||
|
||||
There is an alternative approach that also selects all rows from a table.
|
||||
It's essentially a shorthand -- the `table` command.
|
||||
|
||||
```sql
|
||||
table bedding_types;
|
||||
name
|
||||
----------
|
||||
No Bed
|
||||
1 Full
|
||||
1 Double
|
||||
2 Double
|
||||
1 Twin
|
||||
2 Twins
|
||||
1 Queen
|
||||
2 Queen
|
||||
1 King
|
||||
2 Kings
|
||||
3 Kings
|
||||
Murphy
|
||||
Sofa Bed
|
||||
```
|
||||
|
||||
h/t Jack Christensen
|
||||
Reference in New Issue
Block a user