Postgresql

JOIN difference

If there have 2 tables.

groups

tags

LEFT OUTER JOIN as same LEFT JOIN

SELECT * FROM groups LEFT OUTER JOIN tags ON groups.id = tags.group_id
SELECT * FROM groups LEFT JOIN tags ON groups.id = tags.group_id
--error syntax  select * from groups left inner join tags on groups.id = tags.group_id

RIGHT OUTER JOIN as same RIGHT JOIN

SELECT * FROM groups RIGHT OUTER JOIN tags ON groups.id = tags.group_id
SELECT * FROM groups RIGHT JOIN tags ON groups.id = tags.group_id 
--error syntax  select * from groups right inner join tags on groups.id = tags.group_id

INNER JOIN as same JOIN

SELECT * FROM groups INNER JOIN tags ON groups.id = tags.group_id
SELECT * FROM groups JOIN tags ON groups.id = tags.group_id

FULL outer join join as same join

SELECT * FROM groups FULL OUTER JOIN tags ON groups.id = tags.group_id
SELECT * FROM groups FULL JOIN tags ON groups.id = tags.group_id 
--error syntax  select * from groups FULL inner join tags on groups.id = tags.group_id

update

update subquery

UPDATE dummy
SET customer=subquery.customer,
    address=subquery.address,
    partn=subquery.partn
FROM (SELECT address_id, customer, address, partn
      FROM  /* big hairy SQL */ ...) AS subquery
WHERE dummy.address_id=subquery.address_id;

results matching ""

    No results matching ""