我創(chuàng)建了一個(gè)查詢,以提取他們?cè)谝粋€(gè)多月的時(shí)間內(nèi)獲取的學(xué)生證和飯菜。我想計(jì)算一下學(xué)生在一個(gè)月中服用的每種物品(早餐,午餐,小吃)的數(shù)量。數(shù)據(jù)透視表報(bào)表中似乎有太多數(shù)據(jù)無(wú)法訪問(wèn),因此我希望可以代替它運(yùn)行一個(gè)SQL查詢。這是我創(chuàng)建的當(dāng)前查詢:SELECT April2013.SID, MenuItems.MealType AS Apr2013Meal FROM April2013 LEFT JOIN MenuItems ON MenuItems.Item=April2013.Item; 電流輸出:+-----+-----------+ | SID | Meal | +-----+-----------+ | 001 | Lunch | | 002 | Lunch | | 003 | Breakfast | | 004 | Snack | | 005 | Lunch || 006 | Lunch | | 001 | Breakfast | | 003 | Snack | | 004 | Breakfast | +-----+-----------+這是我想要的樣子:+-----+-----------+-------+---------+ | SID | Breakfast | Lunch | Snack | +-----+-----------+-------+---------+ | 001 | 3 | 10 | 1 | | 002 | 4 | 8 | 10 | | 003 | 18 | 2 | 7 | | 004 | 6 | 7 | 2 | +-----+-----------+-------+---------+
在MS Access中透視數(shù)據(jù)
交互式愛情
2019-12-06 10:24:57