-
Notifications
You must be signed in to change notification settings - Fork 0
DELETE Statement
OneAndonlyFinbar edited this page Jan 22, 2022
·
4 revisions
The SELECT command can be used to select certain aspects of a table.
SELECT
[ALL | COLUMN | AGGREGATE_FUNCTION]
[AS alias]
[FROM table]
[WHERE condition(s)]Aggregate Functions
| Name | Description |
|---|---|
| MAX() | Maximum value for column |
| MIN() | Minimum value for column |
Selecting all rows
SELECT * FROM usersSelect single column
SELECT money FROM usersSelecting maximum value in money column
SELECT MAX(money) FROM usersSelecting maximum value in money column WHERE user is above level 10
SELECT MAX(money) FROM users WHERE level > 10Aliasing column userId to id
SELECT userId AS id FROM users WHERE userId = 5Aliasing maximum userId column to `highestUserId
SELECT max(userId) AS highestUserId FROM users