SupabaseS
Supabase12mo ago
znsh

Inner join not returning data

I'm trying to join 2 tables together, responses and users . Responses is the main table that I'm showing on the UI, but it doesn't contain the user email hence why I'm trying to join. Responses has the user_id column which is a foreign key (I assume) from users. This is the query I wrote, it returns null, if I query each table separately I get the data. What could be the issue?

const { data: users } = await client.from('responses').select(
    `
      *,
      users (
        id,
        email
      )
    `,
  );

  console.log('users', users); // null
Was this page helpful?