Is possible have different conditions for each row in a query?

前端 未结 4 643
甜味超标
甜味超标 2021-01-25 19:26

How I can select a set of rows where each row match a different condition?

Example:

Supposing I have a table with a column called name, I want the

4条回答
  •  醉话见心
    2021-01-25 19:56

    This may be close to what your after... but I need to know where you're getting your values for A, B, C etc...

    Select [insert your fields here]
    FROM
    (Select T1.Name, T1.Age, RowNum as t1RowNum from T T1 order by name) T1O
    Full Outer JOIN 
    (Select T2.Name, T2.Age, RowNum as T2rowNum From T T2 order By name) T2O
    ON T1O.T1RowNum+1 = T2O.T2RowNum
    

提交回复
热议问题