Demo entry 6352298

SQL

   

Submitted by anonymous on Mar 24, 2017 at 10:19
Language: SQL. Code size: 691 Bytes.

FROM    dbo.meter 
LEFT OUTER JOIN
dbo.meter_type ON dbo.meter_type.id = dbo.meter.meter_type_id 
LEFT OUTER JOIN
dbo.medium ON dbo.medium.id = dbo.meter_type.medium_id 
LEFT OUTER JOIN
(SELECT     id, created_timestamp, meter_id, conversion_factor, start_timestamp, is_deleted_timestamp, is_deleted
FROM          dbo.meter_has_conversion_factor AS mhcf1
WHERE      (start_timestamp =
                            (SELECT     MAX(start_timestamp) AS Expr1
                             FROM          dbo.meter_has_conversion_factor AS mhcf2
                             WHERE      (mhcf1.meter_id = meter_id) AND (mhcf1.is_deleted = '0')))) 
AS mhcf ON mhcf.meter_id = dbo.meter.id

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).