如何将表中更多可用的数据列添加到此查询中?我想添加evnt_dat
和evnt_desrp
列。
SELECT DISTINCT
ROW_NUMBER() OVER (ORDER BY
panel_descrp
, cardno
, lname
) rid
, panel_descrp
, cardno
, lname
FROM ev_log
where evnt_descrp = 'local grant'
and datepart(yyyy,EVNT_DAT) = datepart(yyyy,GETDATE())
and DATEPART(mm,evnt_dat) = DATEPART(mm,getdate()) -1
and DATEPART(dd,evnt_dat) >= 1 and DATEPART(dd,evnt_dat)<=2
GROUP BY
panel_descrp
, cardno
, lname