Subquery not working

So as u can see in te pics I am trying to get first from a subquery the firstAvailableSlot. And than in the main query trying to get some doctor infos and only the availableSlots with same doctorId but getting error
No description
No description
1 Reply
rphlmr âš¡
rphlmr ⚡•5mo ago
👋 firstAvailableSlot should not be awaited. Then Drizzle suggests to add firstAvailableSlot.date in your last groupBy because you use an aggregate function in your select (avg). I guess it will ask again to add startTime etc. Maybe you will have to add available_slot.id (primary key) in the sub query and add it in the groupBy instead of all the columns
Want results from more Discord servers?
Add your server