AlisdairO / pgexercises

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

00050000-interval2.ex reference query does not validate with expected results #86

Open rngadam opened 4 months ago

rngadam commented 4 months ago

https://github.com/AlisdairO/pgexercises/blob/master/questions/date/00050000-interval2.ex

copy pasting the example query into "Your answer" fails to validate as it has decimals while the Expected results do not:

select extract(epoch from (timestamp '2012-09-02 00:00:00' - '2012-08-31 01:00:00'));          

can be fixed by turning into an integer with round:

select round(extract(epoch from (timestamp '2012-09-02 00:00:00' - '2012-08-31 01:00:00')));          

but AFAIK the sample result is from that example query in the first place so not sure why.

image