© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
9 replies
((()))

replacing related id with value when querying table

Hello, I've got two tables:

offices
└  id
└ name

employees
└ id
└ office_id
└ name
offices
└  id
└ name

employees
└ id
└ office_id
└ name

office_id in employees table is linked to offices.id.

When I query employees right now, I get something like
[
  {
    "user_id": "0dea707d-2248-4a2e-b8fd-b65578852ca9",
    "office_id": 1,
    "name": "Karen"
  }
]
[
  {
    "user_id": "0dea707d-2248-4a2e-b8fd-b65578852ca9",
    "office_id": 1,
    "name": "Karen"
  }
]


QUESTION:
is it possible to replace that office_id with office name so I get something like this when I query select * from employees

[
  {
    "user_id": "0dea707d-2248-4a2e-b8fd-b65578852ca9",
    "office": "Billing Department",
    "name": "Karen"
  }
]
[
  {
    "user_id": "0dea707d-2248-4a2e-b8fd-b65578852ca9",
    "office": "Billing Department",
    "name": "Karen"
  }
]
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

Replacing my city_id with cities.name
SupabaseSSupabase / help-and-questions
4y ago
Edge Function returning 500 when querying table (Supabase)
SupabaseSSupabase / help-and-questions
17h ago
querying table columns and types
SupabaseSSupabase / help-and-questions
4y ago
querying a table with embeddings in sql editor
SupabaseSSupabase / help-and-questions
3y ago