具有内部联接3的多值选择表

时间:2019-12-17 03:12:59

标签: mysql

如何获得每个结果不多的价值

SELECT annual_leave.id_annual_leave, approve_cuti_tanggal.tanggal_request_izin, tbl_timesheet.shift FROM annual_leave 
INNER JOIN approve_cuti_tanggal ON approve_cuti_tanggal.id_annual = annual_leave.id_annual_leave 
INNER JOIN tbl_timesheet ON tbl_timesheet.id_annual = annual_leave.id_annual_leave
WHERE approve_cuti_tanggal.keterangan='APPROVAL HEAD NOC' AND annual_leave.status='APPROVAL'

enter image description here

来自表Approval_tanggal仅2个值 enter image description here

还有tbl_timesheet enter image description here

1 个答案:

答案 0 :(得分:0)

我认为您可以使用

select distinct * from <table_name>

You can refer to MySQL documentation.