There is a table with fields

SNILS COD VisitDate 4521245 50 30.01.2005 4521245 51 29.01.2005 4521245 52 30.01.2005 4521245 50 28.01.2005 4521251 50 28.01.2005 4521232 19 28.01.2005 4521234 20 28.01.2005 

How to make a request to select those records that have the same dates in the group of the same SNILS (for example, the same dates on January 30, 2005 in the SNILS group 4521245)?

  • And what information is specifically needed. Showed the original data, well, show what else you want to see as a result. And be sure to specify which particular SQL you have. Perhaps window functions would be easier to solve, but not all DBMSs support them - Mike

1 answer 1

Try to add at the end of the query GROUP BY SNILS, VisitDate