Answer the question
In order to leave comments, you need to log in
How to transpose a table to find the minimum value?
Good afternoon.
There is a table
create table #t (a int,
q int,
w int,
e int,)
insert #t values (0,1,2,3)
insert #t values (0,3,1,2)
insert #t values (0 ,2,1,3)
insert #t values (0,2,3,1)
Answer the question
In order to leave comments, you need to log in
DECLARE @t TABLE (a INT, q INT, w INT, e INT )
INSERT @t VALUES (0,1,2,3), (5,4,2,6), (7,1,2,8), (7,9,2,0), (0,0,1,3), (3,1,1,0)
SELECT a, q, w, e, IIF( w < e, IIF( q < w, IIF( a < q, a, q ), w ), e ) AS tMIN
FROM @t
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question