Я получаю сообщение об ошибке «Для функции MAX требуется 1 аргумент (ы)» при запуске из представления ниже. Пожалуйста, кто-нибудь, помогите мне в этом.
CREATE VIEW SQL_RP("ID_NUMERIC", "SAMPLING_POINT", "SAMPLED_DATE", "COMPOSITE_INTERVAL", "TEST_NUMBER", "ANALYSIS", "TEST_COUNT", "COMPONENT_NAME", "RESULT_VALUE", "RESULT_TEXT", "UNITS", "RESULT_TYPE", "RESULT_STATUS", "ENTERED_BY", "UPDATED_DATE")
AS
SELECT sample.id_numeric,
sample.sampling_point,
sample.sampled_date,
sample.composite_interval,
test.test_number,
test.analysis,
test.test_count,
result.name AS component_name,
result.Value AS result_value,
result.text AS result_text,
result.units,
result.result_type,
result.status AS result_status,
result.entered_by,
MAX (ISNULL(test.date_authorised, (GETDATE - 365*100)), ISNULL(result.entered_on, (GETDATE - 365*100)), ISNULL(result.date_authorised, (GETDATE - 365*100)), ISNULL(esav.audit_date, (GETDATE - 365*100)) ) AS updated_date
FROM sample
INNER JOIN test
ON sample.id_numeric = test.sample
INNER JOIN result
ON test.test_number = result.test_number
LEFT OUTER JOIN eims_sample_audit_view esav
ON esav.id_numeric = sample.id_numeric
WHERE result.status <> 'U';