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 7091803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:14:00+00:00 2026-05-28T08:14:00+00:00

I have the following problem (simplified): I have a table that contains animals, e.g:

  • 0

I have the following problem (simplified):

I have a table that contains animals, e.g:

ID       Type      Birthday
1        Dog       1.1.2011  
2        Cat       2.1.2009
3        Horse     5.1.2009
4        Cat       10.6.1999
5        Horse     9.3.2006

I know that all the animals belong to one “family”. From each family I now want to see all the offspring, but I do not want to see the entry for the “founder of the family”.

So for the simple sample above I just want to see this:

ID       Type      Birthday
2        Cat       2.1.2009
3        Horse     5.1.2009

So far I haven’t been able to find a way of grouping the entries and then removing the first entry from each group. I was only able to find how to remove specific lines.

Is it even possible to solve this problem?

Thank you very much for your help. It is much appreciated.

  • 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-28T08:14:00+00:00Added an answer on May 28, 2026 at 8:14 am

    A simple SQL(not necessary efficient can be:)

    select
      id, type, birthday
    from animals
      left join
      (select type, min(birthday) min_birthday
      from animals
      group by type) a 
         on a.type=animals.type and a.min_birthday = animals.birthday
    where a.type is null;
    

    For best efficiency you can use an analytical function:

    select id, type, birthday
    from(
        select
          id, 
          type, 
          birthday, 
          row_number() over (partition by type order by birthday) as rnk
        from animals
    ) a
    where rnk >=2
    

    For more examples with analytical functions, you can read this article

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

Sidebar

Related Questions

I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User
I have the following problem: I have an HTML textbox ( <input type=text> )
I have the following (simplified) Hibernate entities: @Entity @Table(name = package) public class Package
I have the following (highly simplified) XML document that I am reading into my
I have the following db tables (which is simplified to illustrate the problem) CampaignTx
I have the following table (simplified) in an oracle db: productId | modelDescription 1
If I have the following code (simplified version of the problem): class TestA {
I have simplified my problem to the following select statement. select u.UserId, aVariable =
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening

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.