I have a table Employee
create table emp(
id int,
name varchar(50),
age int,
salary int
);
Total rows:
id name age salary
1 Tom 22 2000
2 Mike 12 2000
3 Niki 42 2000
4 Tom 22 2000
5 Yuki 52 2000
6 Niki 42 2000
Here in this table, there are 2 employees (Tom and Niki) with same name, age and salary.
Is there any query which i can write to get below output (In case of matching of name, age and salary, i should get row with minimum id).
id name age salary
1 Tom 22 2000
2 Mike 12 2000
3 Niki 42 2000
5 Yuki 52 2000
How can i achieve this?