[英]How to get get all the data from table and if same value repeated in one column that row should count once?
leave_request table in my table emp_id column contains duplicate data 3 times. 我的表emp_id列中的Leave_request表包含3次重复数据。 i want to select all the data from the table and the duplicate data to count as once.
我想从表中选择所有数据,并将重复数据选为一次。 here i am providing the screenshot of my table structure
在这里,我提供了我的表结构的屏幕截图
You can try below - 您可以在下面尝试-
select max(id),emp_id, emp_name
from tablename
group by emp_id, emp_name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.