Toad World® Forums

Delete Statement Removes Critical Subquery


#1

I am noticing that when I create a delete query, none of the where clause subqueries are used in the SQL. Switching to a select query shows them fine.

Example:

–Select Statement:

SELECT *

FROM tableA

WHERE

tableA.year = ‘2018’ AND

tableA.ID IN

(SELECT ID FROM tableB

WHERE value = ‘x’)

–When switching to delete statement:

DELETE FROM tableA

WHERE tableA.year = ‘2018’

In the visual query builder, the subquery is still visible making it very misleading what is being deleted. The select statement captures <100 records whereas the delete statement deletes >10,000

Am I doing something wrong or does Toad Data Point not support simple subqueries in delete statements?


#2

Sorry this post got missed. Currently we do not support subqueries in insert, delete statements in the Query Builder. I entered QAT-13236 for this enhancement.