© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
PeterCH

querying a table with embeddings in sql editor

I am trying to query a table in sql editor. It is just not working.
Here is my query:
select
documents.id,
documents.content,
1 - (documents.embedding <=> query_embedding) as similarity
from documents
where 1 - (documents.embedding <=> query_embedding) > 0.5
order by similarity desc
limit 1
The query_embedding variable I tried to replace with a 1536 long vector definition beginning with "[
-0.016951786,
-0.01891192,
0.0028827498,...
I tried various varients and none worked. query_embedding had to be defined twice. I was not able to define a variable to pre-define query_embedding like in Oracle's PLSQL.

Does anyone no any better?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Table Editor to SQL
SupabaseSSupabase / help-and-questions
4y ago
SQL Editor
SupabaseSSupabase / help-and-questions
7mo ago
Potential Bug in SQL Editor?
SupabaseSSupabase / help-and-questions
13mo ago
Creating a random_username function with SQL Editor
SupabaseSSupabase / help-and-questions
4y ago