Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started