Link to home
Start Free TrialLog in
Avatar of printmedia
printmedia

asked on

Delete records based on view in sql server

Hi all.

I want to delete the records from TABLE_A that are displayed using the select statement below. How can I do this without deleting all the records from TABLE_A?

Thank you in advance!
SELECT     View_1.Control_No
FROM         View_1 LEFT OUTER JOIN
                      View_2 ON View_1.Dist = View_2.Dist AND 
                      View_1.Qty_Sold_Unit = View_2.UOM AND 
                      View_1.Item_No = View_2.ItemNumber
WHERE     (View_2.ItemNumber IS NULL)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Muhammad Ahmad Imran
Muhammad Ahmad Imran
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial