CREATE VIEW dbo.view_log2
AS
SELECT DISTINCT
l.f_CardRecordID AS ID ,
l.f_CardNO AS CardNo ,
l.f_ReaderID AS rID ,
l.f_Character AS ispass ,
r.f_ReaderName AS disc ,
l.f_ReadDate AS [time]
FROM dbo.t_d_CardRecord l
LEFT OUTER JOIN dbo.v_b_Reader r ON l.f_ReaderID = r.f_ReaderID
WHERE l.f_ReadDate > to_date('2016/9/1 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
AND l.f_ReadDate < to_date('2016/10/1 00:00:00',
'yyyy-mm-dd hh24:mi:ss')
where条件要写在后面啊