使用IN()提高查询性能
我有以下SQL查询: SELECT Event.ID, Event.IATA, Device.Name, EventType.Description, Event.Data1, Event.Data2 Event.PLCTimeStamp, Event.EventTypeID FROM Event INNER JOIN EventType ON EventType.ID = Event.EventTypeID INNER JOIN Device ON Device.ID = Event.DeviceID WHERE Event.EventTypeID IN (3, 30, 40, 41, 42, 46, 49, 50) AND Event.PLCTimeStamp BETWEEN '2011-01-28' AND '2011-01-29' AND Event.IATA LIKE '%0005836217%' ORDER BY Event.ID; …