I'm working on an SQL server database, containing orders and machines, executing those orders. Not more than one active order can be assigned to a machine at the same time. In other words: this SQL request can never yield a result:
SELECT MachineId FROM Orders WHERE (Orders.Status=1) GROUP BY MachineId HAVING COUNT(Id)>1
I have this SQL request open in a Microsoft SQL Server Management Studio environment, and every time I press F5, I indeed see no results.
However, I am sure that there have been times where that SQL query did yield results, and I'm interested in those times and the results of that query at those times.
Does anybody have an idea on how I can find this out? (The "archive-log" tag is just an idea)
Thanks in advance