Updated readme [skip ci]

This commit is contained in:
Andrew Kane
2023-04-01 19:34:21 -07:00
parent 9a7d3532f5
commit e5b612a856

View File

@@ -91,6 +91,18 @@ DELETE FROM items WHERE id = 1;
## Querying
Get the nearest neighbors to a vector
```sql
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
```
Get the nearest neighbors to another row
```sql
SELECT * FROM items WHERE id != 1 ORDER BY embedding <-> (SELECT embedding FROM items WHERE id = 1) LIMIT 5;
```
Use a `SELECT` clause to get the distance
```sql