Unanswered: How to replace data from one col with another col??
I am a new member. Looking for your help. My problem is-
there are 4 tables in a database. such as university, student, professor and worker. university table contains fields named- university_name, student_name, professor_name and worker_name. and student, professor and worker tables contain person_id and person_name.
Now, I want to replace the student_name, professor_name and worker_name data from university table with student table's person_id, professor table's person_id and worker table's person_id.
The method I showed you will update all of them in a single pass. That is what the JOIN is for.
You need to step back a pace or two and spend half a day reading up on SELECT, INSERT, UPDATE, and DELETE statements. Basic stuff, and without this knowledge you can't go anywhere with SQL.
If it's not practically useful, then it's practically useless.