首页 > 解决方案 > 将两个查询合二为一

问题描述

嗨,我是 sql 新手,我只是想征求意见,我的查询工作正常,它给了我想要的输出,但我只想在一个查询中完成我想将我的删除查询与选择查询结合起来。我真的很感激有人能教我怎么做

Delete from tblexample where RStatus = 'Done';
SELECT t3.RStatus,t1.Name,t2.gender,t1.Rnum,t1.NB,t1.fN
FROM table1 t1
INNER JOIN table2 t2 
ON (t1.fN = t2.fln)

LEFT JOIN (

   select * from tblexample t3   
) AS t3  ON  t1.NB = t3.NB  where t3.RStatus is null

如果可能的话,我想在离开之前删除冷杉加入 tblexample

标签: mysqlsql

解决方案


推荐阅读