How to select Distinct curl query?

  • unicodes

    12 days ago

    I'm looking to select from a table all the unique values, is there a way to do it in curl?
  • Erik Beuschau

    12 days ago

    What kind of database/interface are you using?
  • unicodes

    12 days ago

    Hi Erik, I'm using supabase.
  • I believe you can use distinct
  • Something like GET /table?select=distinct=column_name
    ๐Ÿ™1
  • Would have to test it
  • unicodes

    12 days ago

    I tried like this but doesn't work.
  • Screenshot_2025-01-03_at_02.08.19.png
  • Also tried different AI recommendations but nothing :(.
  • Lucas G

    12 days ago

    That link has all the filters
  • I thought I had read distinct on it
  • unicodes

    12 days ago

    there is "isdistinct", but I can not understand how to use it. Also read that there is avg, min - max to simulate "distinct" but is not my case, I want to select distinct ids.
  • Erik Beuschau

    12 days ago

    Postgrest doesn't support distinct/group by/sub queries as far as I know. Instead you can:
    - Reduce the amount of joins you're performing (if that's what gives you duplicate IDs)
    - Use a view
  • unicodes

    12 days ago

    Thank you Erik, I will try to implement it using functions, or to process the information client side.๐Ÿ™
  • Tod

    12 days ago

    Great energy @unicodes! Your continuous contribution to the toddle Community just made you advance to Community Level 14!

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code โ€” but accessible to your entire team!

Try toddle โ€” it's free!

ยฉ Copyright 2024 toddle. All rights reserved.