frosty1
asked on
test sql deleting
I have the following query
DELETE o
FROM Orders o LEFT OUTER JOIN OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1
is there a way i can test this script but not let it actually run so i can see the results
I can of course use a select but i'm not sure the results are the same.
select *
FROM Orders o LEFT OUTER JOIN OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1
DELETE o
FROM Orders o LEFT OUTER JOIN OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1
is there a way i can test this script but not let it actually run so i can see the results
I can of course use a select but i'm not sure the results are the same.
select *
FROM Orders o LEFT OUTER JOIN OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1
What database platform are you using? SQL Server or Oracle?
ASKER
mssql
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> I can of course use a select but i'm not sure the results are the same.
With SELECT statement, you will get those records which can be deleted with DELETE statement.
With SELECT statement, you will get those records which can be deleted with DELETE statement.