I have tried following. Query is working but returning more rows as not expected.
SELECT x,y,z FROM
(SELECT (t1.HOUR*4) + INT (t1.MINUTS/15 ) +1 AS x,t1.AMOUNT as y, t1.DATE,t2.AMOUNT AS z FROM table1 t1
INNER JOIN
(SELECT * FROM table2 WHERE DATE=(SELECT MAX(DATE) FROM table2 ))AS t2
ON t1.STORE=t2.STORE
WHERE t1.DATE = (SELECT MAX(DATE) FROM table1 ))
Sample data:=
STORE DATE DAY_OF_WK HOUR MINUTS AMOUNT
574 13-03-2017 2 0 0 0.00
574 13-03-2017 2 0 15 0.00
574 12-03-2017 2 0 30 0.00
574 11-03-2017 2 0 45 0.00
574 11-03-2017 2 1 0 0.00
574 13-03-2017 2 1 15 0.00
Both table having same data but there is different business logic on amount column.
What I need is to get amount and time id from both tables only of max date.