Combine two queries in to one

Combine two queries in to one



Hi I am new to sql I just want to ask for advice my query is working fine it gives me my desired output but I wanted to make it in one query only I want to combine my delete query to the select query. I would really appreciate anyone can teach me how to do it


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



Like if possible I want to delete firs before I left join the tblexample





You can't. But you can wrap them up in a transaction
– Strawberry
Aug 27 at 8:35





According to my understanding of SQL Concepts it is not possible to combine DML and select statements..
– codeLover
Aug 27 at 8:38





how can I wrap them in transaction?
– Wonderer
Aug 27 at 8:44





What do you mean by "combine"?
– Kamil G.
Aug 27 at 8:45





like if possible delete first then select?
– Wonderer
Aug 27 at 8:46









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)