I am referring to the WHERE clause where I repeat the select max incident_num. Can I store it in a variable, and reference in the second part of the where clause?
Thanks,
gordon
Thanks,
gordon
Code:
SELECT
*
FROM
irsc_incident_dtl T1,
irsc_sts T2,
irsc_usr_tbl T3,
irsc_cat_desc T4
WHERE
T1.incident_num=(select max(incident_num) FROM irsc_incident_dtl)
and T2.incident_num=(select max(incident_num) FROM irsc_incident_dtl)
and T2.lst_upd_date=(select max(lst_upd_date) FROM irsc_sts)
and T1.cat_cd = "OP"