2

mail@pastecode.io avatar
unknown
plain_text
a year ago
389 B
1
Indexable
Never
SELECT
    Name AS Name,
    Description AS Description,
    CASE WHEN IsEnabled = 1 THEN 'ENABLED' ELSE 'DISABLED' END AS Status
FROM
    UserRole
WHERE
    Description IS NOT NULL
    AND TRIM(UPPER(CreatedBy)) = 'JOHN SMITH'
    AND Created > '2020-01-03'
    AND Created < '2020-01-07'
    AND (Updated IS NULL OR COALESCE(Updated, '1970-01-01') = '1970-01-01')
ORDER BY
    Name DESC;