感谢您的审阅。我迫切需要帮助,甚至无法明确以下问题...
使用 SQL 2008,我设置了一个包含五列的表。
数据实际上如下所示:
column1 column2 column3 column4 column5
T1 N1 A1 L1 S1
T1 N2 A2 L2 S4
T1 N2 A3 L2 S2
T1 N2 A1 L2 S4
T2 N6 A3 L3 S2
T2 N7 A3 L3 S4
T2 N7 A3 L4 S4
...
对于具有相同column1
值的记录,我想识别column2
through的每个唯一排列column5
。
我想回答这样的问题:
情况1
有多少记录存在哪里
column1 is the same value and
column2 is the same value and
column3 is the same value and
column4 is the same value and
column5 is different
然后
案例2
column1 is the same value and
column2 is the same value and
column3 is the same value and
column4 is different and
column5 is the same value
然后
案例3
column1 is the same value and
column2 is the same value and
column3 is the same value and
column4 is different and
column5 is different
等等。谢谢!