ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
5 replies
laubonghaudoi

How to count a joined foreign table?

The doc only shows how to count a table without joined foreign tables:
https://supabase.com/docs/guides/database/tables#joining-tables-with-foreign-keys

Using the example below which gets messages from a certain user:
const { data, error } = await supabase
  .from('messages')
  .select('*, users!inner(*)');
const { data, error } = await supabase
  .from('messages')
  .select('*, users!inner(*)');

How to count the joined
users
users
table?
Tables and Data | Supabase
Creating and using Postgres tables.
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
Is it possible to rename a joined table?
SupabaseSSupabase / help-and-questions
3y ago
How to order a joined query?
SupabaseSSupabase / help-and-questions
3y ago
How to get data from foreign table based on parent table
SupabaseSSupabase / help-and-questions
4y ago