6/9 Find the least time value for each item in the table


#1

I really do not have idea how to solve this question.

Replace this line with your code.


#2

In the first step you found the max for cook time and cool down time. Now you need to find the smallest, or least, value for cook time and cool down time.


#3

Thanks very much, it is simple as it could be.


#4

SELECT
id [IDs with a mistake],
MAX(cook_time, cool_down_time) as MAXc,
MIN(cook_time, cool_down_time) as MINc
FROM baked_goods
WHERE MAXc/MINc < 1;

Was trying this code from a different topic but it didn't work. Please advise.


#5

SELECT id, min(cook_time, cool_down_time)
FROM baked_goods;

it work... try!!


#6

Yes, that worked.

I am still unsure how that also processed the max though? it seems that it would only process the min. Unless, the previously processed max had already been processed.

-Av


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.