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
|
||||
|
||||
|
@@ -4,4 +4,4 @@
|
||||
- soundcloud
|
||||
- spotfy
|
||||
- apple music
|
||||
- data stored in [surrealdb](obsidian://open?vault=Miller%20Knowledgebase&file=Databases%2FSurrealDB%2FSurrealDB%20Local%20Setup)
|
||||
- data stored in [[SurrealDB Local Setup]]
|
Reference in New Issue
Block a user