Avatar of devguru001
devguru001
Flag for South Africa asked on

How to delete after selection

Hi Experts

I need to make a deletion of a row that was selected within an inner select.

The idea is :
Select (select min(col) from tableA where tableA.ID = tableB.ID
 DELETE FROM tableA
WHERE tableA.ID = tableB.ID

) [colName]
From tableB

An alternate solution would too be highly appreciated

Thanks
Microsoft SQL Server

Avatar of undefined
Last Comment
Vitor Montalvão

8/22/2022 - Mon
PortletPaul

any chance of using real table and field names?
plus, sample data & expected result?
Jim Horn

Give us a data mockup of what you're trying to pull off here, as looking at your question it's not clear.
ASKER CERTIFIED SOLUTION
PortletPaul

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Vitor Montalvão

COL exists in TableB? And is related to TableA.Col?
Your help has saved me hundreds of hours of internet surfing.
fblack61