我正在尝试生成一个列“性别组合”,它创建了详尽的交互术语类别,如下表所示。有没有一种简单的方法可以在 SQL(微软服务器)中做到这一点?
+--------------+--------------+--------------+---------------------+
| EMP 1 Gender | EMP 2 Gender | Emp 3 Gender | Gender Combinations |
+--------------+--------------+--------------+---------------------+
| Male | | | 1 Male |
| Female | | | 1 Female |
| | Male | | 1 Male |
| | Female | | 1 Female |
| | | Male | 1 Male |
| | | Female | 1 Female |
| Male | Female | | 1 Male, 1 Female |
| | Male | Female | 1 Male, 1 Female |
| Male | | Female | 1 Male, 1 Female |
| | Female | Male | 1 Male, 1 Female |
| Female | | Male | 1 Male, 1 Female |
| Female | Male | | 1 Male, 1 Female |
| | Female | Male | 1 Male, 1 Female |
| Male | | Female | 1 Male, 1 Female |
| | Male | Female | 1 Male, 1 Female |
| Male | Male | Female | 1 Male, 1 Female |
| Male | Female | Male | 2 Males, 1 Female |
| Female | Male | Male | 1 Female, 2 Males |
| Female | Female | Male | 2 Females, 1 Male |
| Female | Male | Female | 2 Females, 1 Male |
| Male | Female | Female | 2 Females, 1 Male |
| Male | Male | Male | 3 Males |
| Female | Female | Female | 3 Females |
+--------------+--------------+--------------+---------------------+