readme: add example SQL query
This commit is contained in:
parent
37149fea2c
commit
a40d6d6ed4
1 changed files with 8 additions and 0 deletions
|
|
@ -35,3 +35,11 @@ Example
|
|||
./shinyr db2api 00000000-0000-0000-0000-00000000007b
|
||||
## 123
|
||||
```
|
||||
|
||||
Using a database ID to query both the activity and object of a post:
|
||||
```sql
|
||||
SELECT a.*, o.*
|
||||
FROM objects AS o JOIN activities AS a
|
||||
ON COALESCE(a.data->'object'->>'id', a.data->>'object') = o.data->>'id'
|
||||
WHERE a.id = '00000198-70ad-868e-8d3a-6d2726850000';
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue