AlisdairO / pgexercises

PostgreSQL Exercises web site code
Other
400 stars 62 forks source link

No `trim` hint for Aggregates / fachours3 exercise #51

Closed T1mL3arn closed 3 years ago

T1mL3arn commented 4 years ago

There is no info about using trim function in the hint (for Aggregates / fachours3 exercise. Visually, the query

select
    f.facid, f.name,
    to_char(sum(b.slots) * 0.5, '999.99') as hours
from cd.bookings as b
join cd.facilities as f on b.facid = f.facid
group by f.facid, f.name
order by f.facid asc
;

gives an answer that looks like the expected one. But due spaces it is a wrong answer. It took a quite time for me to figure out why is my query wrong. (I gave up and pressed Answer button :sweat_smile: )

AlisdairO commented 3 years ago

Good call, thanks! fixed in 128c40e29d091d808bd27d0c578ce54c7ee694d7