SQL Server: Where & Like Statements -
i'm rusty sql game. have code (see below) checks on database instance (instance001, instance002, etc), looks when last_read , last_write fields null, along when last reset. nothing on top. the issue i'm having how execute across multiple instances. you'll see commented out section. if add in appropriate or statement ( or inst_name 'instance002' ), isn't getting results seeking. example: instance001 yields 1 records. instance002 yields 60. if use where inst_name 'instance001' or inst_name 'instance002' 210 records. how manipulate sql provide 61? declare @timestring nvarchar(50) = convert(varchar(24), getdate(), 120) select db_name, inst_name, min([last_srvr_rst]) min_srvr_rst, last_read, last_write, log_date=@timestring cms_db_last_read_write -- targeted db data. inst_name -- targeted instance(s) 'instance001' /* 'instance002' 'instance003' 'instance004' */