我正在使用此脚本,尝试连接2个表,其中包含3个条件并更新T1:
Update T1 set T1.Inci = T2.Inci
ON T1.Brands = T2.Brands
AND T1.Category= T2.Category
AND T1.Date = T2.Date
Run Code Online (Sandbox Code Playgroud)
但我遇到了:
Incorrect syntax near the keyword 'ON'.
无法弄明白为什么.
我如何转换/转换列包含字符串,例如Jan.08,Feb.08 ..进入日期格式,以便我可以对它们进行排序?
非常感谢!
在我的SQL表中:
Period| Brand A small Bags| Brand A big bags| Brand D Shoes| ...| Brand X Shoes
2010 | 10 | 20 | 30 | ...| 200
Run Code Online (Sandbox Code Playgroud)
如何对列名称中包含某些单词(例如鞋子)的列进行求和?
预期成绩:
Period | Sum of Bags | Sum of Shoes | ..
2010 | 30 | 230 | ..
Run Code Online (Sandbox Code Playgroud)