我已使用以下查询选择“重复表”
SELECT
y.Entity,y.ExpenseTypeCode,y.ExpenseType,y.LOB,y.Center,y.Location,y.Amount,y.APSupplierID,y.ExpenseReportID,y.Employee,y.ReportDate,y.ExpenseDate,y.Description
FROM dbo.TotalsByGLCenter$ y
INNER JOIN (SELECT
Entity,ExpenseTypeCode,ExpenseType,LOB,Center,Location,Amount,Description,APSupplierID,ExpenseReportID,Employee,ReportDate,ExpenseDate, COUNT(*) AS CountOf
FROM dbo.TotalsByGLCenter$
GROUP BY Entity,ExpenseTypeCode,ExpenseType,LOB,Center,Location,Amount,APSupplierID,ExpenseReportID,Employee,ReportDate,ExpenseDate,Description
HAVING COUNT(*)>1
) dt ON y.Entity=dt.Entity and y.ExpenseTypeCode=dt.ExpenseTypeCode and y.ExpenseType=dt.ExpenseType and y.LOB=dt.LOB and y.Location=dt.Location and y.Center=dt.Center and y.Amount=dt.Amount and y.APSupplierID=dt.APSupplierID and y.ExpenseReportID=dt.ExpenseReportID and y.Employee=dt.Employee and y.ReportDate=dt.ReportDate and y.ExpenseDate=dt.ExpenseDate and y.Description=dt.Description
我想要删除选定的查询。如何使用删除上面的查询语句?
最佳答案
试试这个伙伴,
DELETE FROM your_table WHERE id IN (
Select (
your select query
) As alias
)
关于mysql - 如何删除已经选择的表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39873135/