검토해 주셔서 감사합니다. 나는 도움을 절실히 필요로하고 아래의 질문에 명확한 문제가 발생했습니다 ...여러 개의 키 값의 순열을 식별하는 방법
SQL 2008을 사용하면 테이블이 5 개의 열로 설정되어 있습니다.
데이터를 효과적으로 다음과 같습니다 : 같은 column1
값이 기록에 대한
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
...
, 나는 column5
을 통해 column2
의 각각의 고유 한 순열을 식별 할 수 있습니다. 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
존재케이스 :
는이 같은 질문에 대답 할 0
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
등등. 감사!
당신은 'count (distinct column5)'를 사용할 수 있습니다. –
테스트하고보고 할 것입니다. 고맙습니다. –