Saturday , December 21 2024

Update From Another Table In PostgreSQL

In PostgreSQL, we may want to update the records from another table, for this we will use the update clause, but this time we will add the word FROM.

We have two separate tables below, we will enter the data in the büt columns of the ogrenci_u1 table in the büt column of the ogrenci_büt table.

You can use the following plpgsql statement for the desired condition above.

In the picture above, we see that 9 records are affected, let’s see if our data has been transferred to the main table, the ogrenci_u1 table.

As seen above, we have added the büt grades of the students in the student_büt table to the büt column.

Loading

About Faruk Erdem

Leave a Reply

Your email address will not be published. Required fields are marked *