I have a table that contains a separate row for each item in an order. Each row for an order should have the same date. Unfortunately, some don't. I need to detect which orders has a row with a date that is different from the other rows for the same order.
In table 'Orders' I am searching for row like this. Row 111 has a date different from the other rows. How do I detect this in a SQL Query? I can't specify the OrderID. I need to search a large table in one query.
ID OrderID ShipDate
111 1001 2009-05-12 00:00:00.000
112 1001 2010-01-26 00:00:00.000
113 1001 2010-01-26 00:00:00.000
114 1001 2010-01-26 00:00:00.000
SQL Server 2008