Dashboard Building and Organizing Complex Queries 3/10 The With Clause

The DQ sample answer pre-calculated the length_seconds in the subquery base on integer division and truncated factions of a second per track before it is aggregated in the main query.

DQ Code:

WITH playlist_info AS
         p.name playlist_name,
         t.name track_name,
         (t.milliseconds / 1000) length_seconds /* integer division truncated fractions of a second */ 
     FROM playlist p
     LEFT JOIN playlist_track pt ON pt.playlist_id = p.playlist_id
     LEFT JOIN track t ON t.track_id = pt.track_id

I apply the conversion to seconds in the main query instead of the subquery and get different length_seconds in some play list.