From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #59: Question: is it possible to infer value for multiple points?
Date: Mon, 20 Feb 2023 05:18:26 +0000
Message-ID: <gh-pgvector-pgvector-59-c1436346940@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-59@github.com>
References: <gh-pgvector-pgvector-59@github.com>
Hey @JDRanpariya, you can use `UNION ALL` to combine queries in Postgres.
```sql
(SELECT 1 AS query, * FROM items ORDER BY embedding <-> '[1,2,3]' LIMIT 1)
UNION ALL
(SELECT 2 AS query, * FROM items ORDER BY embedding <-> '[4,5,6]' LIMIT 1);
```