例如數據分組順序depands在SQL
orderid productid
1 1
1 2
1 3
2 2
2 3
3 1
4 3
4 2
5 1
6 2
7 2
8 1
8 2
結果是
odcnt orderid productid
2 3 1
2 5 1
2 6 2
2 7 2
2 2 2
2 2 3
2 4 2
2 4 3
1 8 1
1 8 2
1 1 1
1 1 2
1 1 3
哪裏odcnt列從何而來? – jarlh
訂單和產品匹配總數。 like product 1 have only two order in single odcnt is 2,and for like like order 2 and 4 have like same item and two order same for multiple ... ... – Lee