I want to update a row based on the existence of an id in other table that is also in that table. In other words that id is a primary key in other table and just a column in the table I want to update.

I want to update based in the same id.

I have this query but it doesn't work because of the SQL syntax.

```
UPDATE
transaction
SET
    DaysRented = 3,
    Cost = 3,
    TotalCost= 5
FROM 
 transaction

INNER JOIN
    rentals
ON
     transaction.idRentals = rentals.idRentals;

```