I have the following query:
use northwind
select left(shipname, (select max(ProductID) from [order details] where OrderID = O.OrderID)) as test
FROM Orders O
but DO NOT RUN on anything but a test server as it will max out the processing power, and I cant even seem to cancel the query. I have to end the sqlservr process and restart the service.
I also cannot get an estimated execution plan.
I ran something similar to this overnight and it was still using all process power over 16 hours later.
however if I take out the left function:
select O.OrderID, (select max(ProductID) from [order details] where OrderID = O.OrderID) as test
FROM Orders O
the query runs instantly.
Whats going on?????
Anybody know a way round this problem?
use northwind
select left(shipname, (select max(ProductID) from [order details] where OrderID = O.OrderID)) as test
FROM Orders O
but DO NOT RUN on anything but a test server as it will max out the processing power, and I cant even seem to cancel the query. I have to end the sqlservr process and restart the service.
I also cannot get an estimated execution plan.
I ran something similar to this overnight and it was still using all process power over 16 hours later.
however if I take out the left function:
select O.OrderID, (select max(ProductID) from [order details] where OrderID = O.OrderID) as test
FROM Orders O
the query runs instantly.
Whats going on?????
Anybody know a way round this problem?