join postgres example

Example 1: mysql UPDate with enner join

UPDATE T1, T2,
[INNER JOIN | LEFT JOIN] T1 ON T1.C1 = T2. C1
SET T1.C2 = T2.C2, 
    T2.C3 = expr
WHERE condition

Example 2: psql join

SELECT *
    FROM weather INNER JOIN cities ON (weather.city = cities.name);

Example 3: postgres join

-- This is in postgreSQL

-- We have tableA and tableB, x is primary key in tableA and also
-- a foreign key in tableB as y
SELECT * FROM tableA JOIN tableB ON tableA.x = tableB.y;

-- This will select all the columns from both tables that share a key

Tags:

Sql Example