Untitled

mail@pastecode.io avatar
unknown
sql
a month ago
503 B
2
Indexable
Never
DECLARE @lrn NVARCHAR(22) = 'LRN_VALUE.....';


SELECT
    tsd.lrn,
    status_tsd.tsd_status_id,
    status_tsd.validfrom_timestamp,
    status_tsd.status_type_id,
    tsd_status_type.tsd_status_type_name
FROM
    dbo.tsd AS tsd
INNER JOIN
    dbo.status_tsd AS status_tsd ON tsd.tsd_id = status_tsd.tsd_id
INNER JOIN
    dbo.tsd_status_type AS tsd_status_type ON status_tsd.status_type_id = tsd_status_type.tsd_status_type_id
WHERE
    tsd.lrn = @lrn
ORDER BY
    status_tsd.validfrom_timestamp DESC;
Leave a Comment