在这里,我有一个 SQL 语句,它正在检索所有正确的东西,但我需要它是 DISTINCT。
因此,对于 WEEK_NUMBER,其返回的 week_number = 1,1,1,1,1,1 等
我希望它浓缩为 1。这是一个 3 表查询,我不确定如何包含 SELECT DISTINCT 功能或替代方案,有什么想法吗?
SELECT WEEKLY_TIMECARD.*,DAILY_CALCULATIONS.*,EMPLOYEE_PROFILES.EMPLOYEE_NUMBER
FROM WEEKLY_TIMECARD, DAILY_CALCULATIONS, EMPLOYEE_PROFILES
WHERE EMPLOYEE_PROFILES.EMPLOYEE_NUMBER = WEEKLY_TIMECARD.EMPLOYEE_NUMBER
AND EMPLOYEE_PROFILES.EMPLOYEE_NUMBER = DAILY_CALCULATIONS.EMPLOYEE_NUMBER
AND WEEKLY_TIMECARD.WEEK_NUMBER = DAILY_CALCULATIONS.WEEK_NUMBER