Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
来自数据库c#sql的组合_C#_Mysql_Combinations_Permutation - Fatal编程技术网

来自数据库c#sql的组合

来自数据库c#sql的组合,c#,mysql,combinations,permutation,C#,Mysql,Combinations,Permutation,我在c#工作。我的数据库中有如下所述的数据 ID ParentID 11 2.1 3.2 4.2 5.2 6.3 7.3 8 3 我想得到基于父Id的所有Id组合,作为一个组或什么的。就是 1,3,6 1,3,7 1,3,8 1,4,6 1,4,7 1,4,8 1,5,6 1,5,7 1,5,8 2,3,6 2,3,7 2,3,8 等等 当我的parentId是动态的时,如何获取所有组合。它可以是1,2,3。。。也要到50岁。你大大低估了可能涉及的组合数量。如果您有50个元素,那么可以使用数万亿

我在c#工作。我的数据库中有如下所述的数据

ID ParentID
11
2.1
3.2
4.2
5.2
6.3
7.3
8 3

我想得到基于父Id的所有Id组合,作为一个组或什么的。就是

1,3,6
1,3,7
1,3,8

1,4,6
1,4,7
1,4,8

1,5,6
1,5,7
1,5,8

2,3,6
2,3,7
2,3,8

等等


当我的parentId是动态的时,如何获取所有组合。它可以是1,2,3。。。也要到50岁。

你大大低估了可能涉及的组合数量。如果您有50个元素,那么可以使用数万亿种不同的方式组合它们。@e4c5是的。现在我明白了其中的复杂性。。。