© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
8 replies
Bamsespartymix

SQL query help

Hi! Dev student here, new to both Supabase and databases in general. Trying tro write a function with SQL but get the error "syntax error at or near "" ". Can't figure out what i am doing wrong.. help pls! 🙏
create or replace function get_dates(user_id_input uuid, friend_id_input uuid) returns setof record language sql as $$ 
SELECT date, COUNT(date)
FROM available_dates
where user_id = (user_id_input)
or user_id = (friend_id_input)
GROUP BY date
HAVING COUNT(date) > 1;
$$;
create or replace function get_dates(user_id_input uuid, friend_id_input uuid) returns setof record language sql as $$ 
SELECT date, COUNT(date)
FROM available_dates
where user_id = (user_id_input)
or user_id = (friend_id_input)
GROUP BY date
HAVING COUNT(date) > 1;
$$;
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

Error SQL query
SupabaseSSupabase / help-and-questions
7mo ago
SQL to Supabase query
SupabaseSSupabase / help-and-questions
3y ago
issues with sql query
SupabaseSSupabase / help-and-questions
4y ago
Expose Schema via SQL Query
SupabaseSSupabase / help-and-questions
5mo ago