vault backup: 2024-01-01 23:25:40
This commit is contained in:
@@ -83,7 +83,22 @@ SELECT *, (SELECT * FROM events WHERE type = 'activity' LIMIT 5) AS history FROM
|
||||
### Multiple targets with `FROM`
|
||||
|
||||
```SQL
|
||||
-- This command selects all records from both 'user' and 'admin' tables.
|
||||
SELECT * FROM user, admin;
|
||||
|
||||
-- This command selects all records from the table named in the variable '$table',
|
||||
-- but only if the 'admin' field of those records is true.
|
||||
-- This query is equivalent to 'SELECT * FROM user WHERE admin = true'.
|
||||
LET $table = "user";
|
||||
SELECT * FROM type::table($table) WHERE admin = true;
|
||||
|
||||
-- This command selects a single record from:
|
||||
-- * the table named in the variable '$table',
|
||||
-- * and the identifier named in the variable '$id'.
|
||||
-- This query is equivalent to 'SELECT * FROM user:admin'.
|
||||
LET $table = "user";
|
||||
LET $id = "admin";
|
||||
SELECT * FROM type::thing($table, $id);
|
||||
```
|
||||
### `UPDATE` examples
|
||||
|
||||
|
Reference in New Issue
Block a user