Skip to content

Tag: join

When to use right join or full outer join

I work with DB / SQL almost on a daily basis and the more I work with sql, the more I’m the opinion that there is no reason to use a right join or a full outer join. Let’s assume we have two tables: table1 and table2. Either I want to receive additional information for the rows in table1 so

Is it possible to join a table to itself

I have a query that joins two tables together. In table O I have an employee ID, which I join to the HR table to retrieve the employee name: inner join hr AS hr on o.syscreator = hr.res_id Also on …

mysql update with if and max

I have lost hours on this and nothing works for me. I have filed strp_aa that is default NULL. The filed strp_aa should update only if its null with MAX strp_aa + 1, and if its not null if it already has a number it should stay the same. short version of code is Also tired I tried multiple things