I am developing a frontend application in VBA, which is linked to an Oracle database.
In Oracle there are the two tables
Table1
and Table2
, which are related to each other by expTypeID and measID:
Table1
expTypeID | measID| val
12 20001 1.1
13 20002 200
13 21043 250
12 29321 0.9
13 29322 150
15 23450 23000
Table2
expTypeID | measID | productID | productName
12 20001 100023 Apple
13 20002 100023 Apple
13 21043 129842 Pear
12 29321 198372 Orange
13 29322 198372 Orange
I would like to get a new table, that for all products contains the values for specific expTypeIDs in different columns, e.g expTypeID = 12 -> ""Density"" and expTypeID = 13 -> ""EModulus"":
GoalTable
productName | productID | Density | EModulus
Apple 100023 1.1 200
Pear 129842 - 250
Orange 198372 0.9 150
I know that it is possible when all the necessary data is available in one table: show-one-column-data-as-two-columns-in-sql (I found the query proposed by mat particularly useful). Is it still possible when the data is present in two tables?
Thanks in advance
Asked by JAUGRY
(3 rep)
Oct 20, 2021, 06:57 AM
Last activity: Oct 20, 2021, 08:15 AM
Last activity: Oct 20, 2021, 08:15 AM