Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does access realize column switching
How does access realize column switching
What if there is no definite column name in the salary column? Wages are counted by other tables.

-

Make other tables embedded or view implementations, for example

choose ...

from

(Select ID, sum (num) as num from test 2 group by ID) as test.

....

choose

Max(iif(OBJECT=' basic salary', salary, 0)) as the basic salary,

Max(iif(OBJECT=' overtime pay', salary, 0)) as overtime pay,

Max(iif(OBJECT=' food subsidy', salary, 0)) as food subsidy.

From testing;

or

Conversion Maximum (Salary)

Select 1 from the test group as the ID.

Pivot object