I have two tables:
1) Table A with columns: id,c2,c3
2) Table B with columns: pid,c2
I want to join them such that, for A.id=B.pid, join columns c2 and c3 from A with the matching row in table B.
pid can occur multiple times in table B ,but id occurs only once in table A.
I saw other solutions and tried this:
cursor.execute("""SELECT A.c2, A.c3, B.c2
FROM A
INNER JOIN B
ON A.id=B.pid""")
conn.commit()
The code executed successfully but no changes were reflected in the tables.
I can provide actual data of tables and columns if required.
UPDATE
I understood that SELECT will only select and not update the data in the table B, but I still don't understand how to code the problem.