Item No Date Item Type Item No Date Item Type
12345 12/17/2021 High 12345 12/17/2021 HIGH
23456 12/17/2021 Low 23456 12/17/2021 Low
78901 12/17/2021 Out 78901 12/17/2021 Out
12345 11/17/2021 Low 12345 11/17/2021 Low
23456 11/17/2021 High 23456 11/17/2021 High
78901 11/17/2021 Low 78901 11/17/2021 Low
12345 12/17/2021 HIGH
23456 12/17/2021 High Result Table
78901 12/17/2021 Low
78901 12/17/2021 High
Source table
I have source table at right side and require result table at left side. Result are on basis of column 'ITEM TYPE' :- Out, High , Low . IF I have 2 row having different 'ITEM TYPE' then it should select only one value on basis of Out>Low>High. Eg:- If 'ITEM NO' Have value 12345 and it has High , Low and High, then it it should take value as High. If it has Low and High only then it should take it as Low and if it has only High , it will take it as High. Please help me with query , how I can achieve it.