Question: I am using this query to get the latest requests from a table and somehow it is not giving me the latest dates. Is there

I am using this query to get the latest requests from a table and somehow it is not giving me the latest dates. Is there another way to write it? I thought the MAX function was going to give me the latest date.

SELECT * FROM global_data.process_logger p1 WHERE last_request = (SELECT MAX(last_request) FROM global_data.process_logger p2 WHERE p1.process_name = p2.process_name);

This the db I am using and the dates I should be getting should be from February.

I am using this query to get the latest requests from a

When I run the query this is what I am getting. Dates from January. Any help catching the error would be appreciated. I am using postgresql.

table and somehow it is not giving me the latest dates. Is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!