Home > database > According to the statistical problems
According to the statistical problems
Time:10-10
Have a table, what is need to statistics of the different types of work order number and problem is that the type is dynamic, in some more, some less, in about 30 or so:
Table is as follows: Working type work order number 01 how a02 b000001 01 c01 b000002 03 c01 b000003 01 how a02 b000004 01 b05 b000005 02 c01 b000006 . After the summary is as follows:
Working how a02 b05 c01 01 2 1 1 02 1 03 1
Plans to use the PIVOT, but if not, because the type is dynamic, and more,
thank you
CodePudding user response:
Can only use dynamic statement, Mr Into statements, execute it again,
CodePudding user response:
Staff will have any changes, if not, can not swap rows and columns,