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

  • Home
  • SEARCH
  • 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 8185587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:54:02+00:00 2026-06-07T01:54:02+00:00

Here I have some articles: id text group_id source_id 1 t1 1 1 2

  • 0

Here I have some articles:

id  text  group_id source_id
1   t1    1        1
2   t2    1        1
3   t3    2        2
4   t4    3        4

So I want to have records in result ordered by created_at column (it exists, but I didn’t show it in table) and having distinct group id, such as that:

id  text  group_id source_id
1   t1    1        1
3   t3    2        2
4   t4    3        4

Also, I should be able to filter result with source_id.

I’m stuck with this question for two days and don’t even know how to start solve problem.

  • 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-06-07T01:54:06+00:00Added an answer on June 7, 2026 at 1:54 am

    Assuming you want the minimum values of the non-duplicated columns, try:

    select   min(id) as id, 
             min(text) as text, 
             group_id, 
             source_id, 
             min(created_at) as created_at
    from     articles
    where    source_id = @your_parameter_value
    group by group_id,
             source_id
    order by 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code here which works perfectly in firefox but not in chrome
I have some doubt on wget command. Here is the thing I want to
I have been reading lots of articles and also questions here on SO but
I want to use the text input field seen here: http://simple-form-bootstrap.plataformatec.com.br/articles/new (It's the second
I have some code here that uses bitsets to store many 1 bit values
I have some code here to call minizip(), a boilerplate dirty renamed main() of
I have some question over here regarding the java garbage collector. First let me
I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I have some complex types here so I decided to use nifty trick to
I'm have some difficulties here, I am unable to successfully call a method which

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.