ソリューションダミーデータ
と
ORACLE
SELECT *
FROM SALARY_TABLE
WHERE NAME = 'whatever_the_name_is'
AND TRUNC(HIKE_DATE,'YYYY') = TRUNC(SYSDATE,'YYYY');
サンプル・クエリのための
WITH SALARY_TABLE AS -- Sample data queried from DUAL
(SELECT 1 AS ID,
'aaa' AS name,
10000 AS salary,
TO_DATE('10/2/2014', 'dd/mm/yyyy') AS hike_date
FROM dual
UNION
SELECT 2, 'aaa', 15000, TO_DATE('06/04/2015', 'dd/mm/yyyy') FROM dual
UNION
SELECT 3, 'aaa', 20000, TO_DATE('16/07/2016', 'dd/mm/yyyy') FROM dual
UNION
SELECT 3, 'aaa', 25000, TO_DATE('10/04/2017', 'dd/mm/yyyy') FROM dual
)
SELECT * -- Actual solution
FROM SALARY_TABLE
WHERE NAME = 'aaa'
AND TRUNC(HIKE_DATE,'YYYY') = TRUNC(SYSDATE,'YYYY');
あなたは 'MySQL'または' Oracle'を使用していますか? – Siyual
MySQLまたはOracleを使用していますか? (別の製品、異なる日付/時刻関数) – jarlh
両方が必要です – MahiA