How to select Distinct curl query?

  • uunicode-1324356642237845557

    unicodes

    4 months ago

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

    Erik Beuschau

    4 months ago

    What kind of database/interface are you using?
  • uunicode-1324496352406933605

    unicodes

    4 months 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
  • uunicode-1324529845224607876

    unicodes

    4 months ago

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

    Lucas G

    4 months ago

    That link has all the filters
  • I thought I had read distinct on it
  • uunicode-1324530440572371097

    unicodes

    4 months 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.
  • erikbeus-1324638079377473618

    Erik Beuschau

    4 months 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
  • uunicode-1324681137284710482

    unicodes

    4 months ago

    Thank you Erik, I will try to implement it using functions, or to process the information client side.🙏
  • Tod-1324681138647732234

    Tod

    4 months ago

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