The longitudinally transversely, it is variable, finding the information says the following stored procedures:
Declare @s varchar (8000) set @S = '' SELECT @ S = @ S ', [' CAST (YGXZ As Varchar) '] = SUM (Case Ygxz When' ' Cast (YGXZ As Varchar) '' 'Ten 1 End' from xxxbgroup by BM
Exec ('SELECT BM' @ S 'from xxxb group by bm')
But I don't know how to perform the above stored procedure, can you copy the code directly to the VB process (if you can't, right?), Do you have to create a stored procedure in SQL? How to call? Specifically, please explain, grateful!
(I am a newbie, the memory process is unless, more detailed, better.)