Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 686369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:01:03+00:00 2026-05-14T02:01:03+00:00

Hope this makes sense… Is there a simple way to return a set of

  • 0

Hope this makes sense…

Is there a simple way to return a set of values from a table based on a single column’s values being distinctly unique? What I’m hoping for is something like:

SegCode.query.filter(ref.unique()).only('ref')

That’s not real code, but I was hoping there was some simple function out there that will accomplish this…


E.g. Table might look like:

1 | abc | 123 | AAA  
2 | def | 456 | AAA  
3 | ghi | 789 | BBB  
4 | jkl | 012 | CCC  
5 | mno | 345 | CCC  
6 | pqr | 678 | CCC  
7 | stu | 901 | DDD  
8 | vwx | 234 | DDD  

So, I’d like a set that comes back with: [AAA, BBB, CCC, DDD]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:01:03+00:00Added an answer on May 14, 2026 at 2:01 am
    SegCode.objects.values_list('ref', flat=True).distinct()
    

    I think this is what you’re after, your question isn’t really that clear

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this makes sense, I am trying to store a SQL Server 2008
hope this makes sense. I have merged together two tables one containing information about
I hope this makes sense. I have created several WPF User Controls. The lowest
Hope this makes sense, I am using Titanium mobile to build an iPhone app.
I hope this makes sense... It doesn't only apply to c#, but that is
i hope this makes sense for you, i get confused. let me know if
I hope this makes sense. I have a Windows Phone 7 app that is
I have an issue with jQuery and Safari (5.03). Hope this makes sense. I
I hope this makes sense. I'm using Java with the Slick2d library, that probably
I am just getting started with expression trees so I hope this makes sense.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.