Skip to content
Advertisement

Join rows with same UnitOfMeasureId from two different tables

I know this is pretty basic, but I am having trouble figuring out this syntax and there is not a lot of content that I could find for these type of sql queries.

I have a UnitOfMeasure Table in my db, then I have UnitOfMeasureSize. UOM Size has sizes for the UnitOfMeasure and each row has the their specific UnitOfMeasure Id.

I want to write a sql query to grab the Unit of Measure, then each UOM size by the UOM Id.

Unit Of Measure Unit Of Measure Size

Advertisement

Answer

Assume that the upper table is ‘table1’ and the below table as ‘table2’

SQL> SELECT table1.UnitOfMeasureId, table2.UnitOfMeasureSize FROM Table1 INNER JOIN table2 WHERE table1.UnitOfMeasureId = table2.UnitOfMeasureId;
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement