SELECT
t1.station_name as stationName,
t1.calculated_value_name as calculatedValueName,
t1.value,
t1.created,
CAST((t1.value+50) AS DECIMAL(12,3)) as limitValue
FROM d_full_limit_transmission_line t1
INNER JOIN (
SELECT
SUBSTRING_INDEX(
group_concat(id ORDER BY created DESC),
',',
1
) AS id
FROM
d_full_limit_transmission_line
GROUP BY
unique_identification
WHERE
t1.STATUS = 1
AND t1.is_deleted = 0
AND t1.is_enable = 1
AND t1.calculated_value_name is not NULL