[ad_1]

I’m attempting to make use of Hive QL to retrieve information from the database. I’ve 2 columns start_time having the beginning time and time_stamp which is recorded for every of the works carried out ranging from ‘Start_time’

JOB         start_time              work_done             time_stamp

JOB_A     2021/12/29 11:00:00       work_A            2021/12/29 11:00:00
JOB_A     2021/12/29 11:00:00       work_A            2021/12/29 11:20:00
JOB_A     2021/12/29 11:00:00       work_B            2021/12/29 11:45:00
JOB_B     2021/12/29 11:00:00       work_A            2021/12/29 12:00:00
JOB_B     2021/12/29 11:00:00       work_A            2021/12/29 12:15:00
JOB_B     2021/12/29 11:00:00       work_B            2021/12/29 12:30:00

What I need is the start_time of JOB_A and the time_stamp the place JOB_A and JOB_B ends

JOB         start_time                     time_stamp

JOB_A     2021/12/29 11:00:00            2021/12/29 11:45:00
JOB_B     2021/12/29 11:00:00            2021/12/29 12:30:00

I attempted to make use of

choose 
JOB,
start_time,
max(time_stamp)
from table_1

I’m nonetheless getting the identical desk as my output

[ad_2]

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *