I wanted to convert the following nested query into a join.
query = """ INSERT INTO ptable
(a,b,c)
(SELECT %d, 'valll',id
FROM btable
WHERE e = %d
AND f = %d);
""" %(Data1,data2, data3)
That’s not a nested query.
For a nested query you need to have many tables in the same select.