select
CustomerName,City,State, MatchId,ServingSize, Fruit, DarkGreen,
[Red/Orange], Legumes, Starchy, Other, [Grains (oz)],
[Whole51%orgreater?], [Meat / Meat Alt], [Fluid Milk (cups)], Calories,
[Sodium (MG)], [Saturated Fat (grams)], [Trans Fat (grams)],
MeetsAllianceForAHealthierGenerationGuidelines, OtherNotes, Name,
WebsiteLinkToSource, Date
from
#FinalTempTable
Where
(
MatchId,ServingSize, Fruit, DarkGreen, [Red/Orange], Legumes, Starchy,
Other, [Grains (oz)], [Whole51%orgreater?], [Meat / Meat Alt], [Fluid Milk (cups)],
Calories, [Sodium (MG)], [Saturated Fat (grams)], [Trans Fat (grams)],
MeetsAllianceForAHealthierGenerationGuidelines, OtherNotes, Name,
WebsiteLinkToSource, Date
)
IN
(
Select
MatchId,ServingSize, Fruit, DarkGreen, [Red/Orange], Legumes,
Starchy, Other, [Grains (oz)], [Whole51%orgreater?], [Meat / Meat Alt],
[Fluid Milk (cups)],Calories, [Sodium (MG)], [Saturated Fat (grams)],
[Trans Fat (grams)], MeetsAllianceForAHealthierGenerationGuidelines,
OtherNotes, Name, WebsiteLinkToSource, Date
From
MealContributions
Where
MatchId IN (Select distinct MatchId from #FinalTempTable)
)
我正在使用这个查询,但它给出了以下错误:
消息 4145,级别 15,状态 1,第 10 行 在预期条件的上下文中指定的非布尔类型表达式,靠近“,”。
我想要#finaltemptable 中的所有列,并且只有那些MatchId 与#finaltemptable matchid 相同的mealcontributions 列