Well, I have to match the values from the column 'TotalAmount' with the calculation of two columns (UnitPrice and Quantity)
My guess is that I need to use Case statement but I don't know where to locate the multiplication.
Also, maybe I should create another column within the same table with the results of the multiplication and then do the matching?
Here is the table: enter image description here
Thanks in advance
WITH T AS ( SELECT (quantity*unitprice) as total
FROM tb1 )
(SELECT *
FROM T
INNER JOIN tb1 ON tb1.totalAmount=T.total
)
Below are the screenshots Data