Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4mo agoβ€’
4 replies
Fathul Bilad

How to use .or() filter with joined table columns in Supabase?

Hey everyone! I'm trying to search across both a main table column and a joined table column using .or(), but I keep getting a parse error.
What I'm trying to do:
Search for jobs by either job title OR company name (from joined table)

My code:
typescriptlet query = supabase.from("jobs").select(

  *,
  company:companies!inner(id, name)

  *,
  company:companies!inner(id, name)
, { count: "exact" });

// This fails with parse error
query = query.or(
title.ilike.%${searchTerm}%,companies.name.ilike.%${searchTerm}%
title.ilike.%${searchTerm}%,companies.name.ilike.%${searchTerm}%
);
**Error I'm getting:**
**Error I'm getting:**

"failed to parse logic tree ((title.ilike.%air%,companies.name.ilike.%air%))"

What I've tried:

Using company.name (the alias) - doesn't work
Using companies.name (the table name) - doesn't work
Using just .ilike() twice creates an AND condition, not OR

Question:
Is it possible to use .or() to filter on joined table columns? If not, what's the recommended approach for "search by title OR company name" functionality?

Thanks in advance!
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

How to filter on joined table
SupabaseSSupabase / help-and-questions
4y ago
Joined table filter includes null values
SupabaseSSupabase / help-and-questions
9mo ago
Filter original records, given a joined table
SupabaseSSupabase / help-and-questions
14mo ago
How to count a joined foreign table?
SupabaseSSupabase / help-and-questions
4y ago