select device_id ,
product."name" as "device_type",
event_time::date as date , 
event_time::time as time,
code , 
value
from "device-status-log" dsl 
join product 
	on dsl.product_id = product.prod_id 
join device d 
	on d."uuid" = dsl.device_id 
order by 1,3,4