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.
A simple SQL(not necessary efficient can be:)
For best efficiency you can use an analytical function:
For more examples with analytical functions, you can read this article