Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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.

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions