I currently have a Query I'm running daily and I'd like to exclude certain items from this Query that I've already identified as not wanting to see without adding another table to the database. Below is my attempt at this, which works with one TaskID but not multiple TaskIDs as I'm trying to do. I feel its also important to note that this list could grow into roughly 150 ID's but not necessarily over 200 if that makes a difference. Obviously the way I did it is not the best way. Can anyone recommend the best way to accomplish this?
Direct Question: What is the best way to exclude a large number of TaskID's from the below query without creating another table?
SELECT TaskID,max(timeended) as 'Last Run' from [moveitautomationagain].[dbo].taskruns where TaskID <> 222300 OR TaskID <> 103439128 group by TaskID having DATEDIFF(hour,max(timeended),sysdatetime()) > 24