|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
第一:
使用UNION或UNION ALL连接时,后面的AS会自动忽略,以第一个为准。
如:
select [Group],[ID],"Technical Skill" as [Category],"SQL" as Skill,[SQL] as Type form [Data]
union all
select [Group],[ID],"Technical Skill" as [Category],"Shell" as Skill,[Shell] as Type form [Data]
可以简写成:
select [Group],[ID],"Technical Skill" as [Category],"SQL" as Skill,[SQL] as Type form [Data]
union all
select [Group],[ID],"Technical Skill" ,"Shell" ,[Shell] form [Data]
第二:
"[ ]"只有在特殊的名称(如字段名称含空格等)才一定要用"[]",一般情况均可以省略
如:
select [Group],[ID],"Technical Skill" as [Category],"SQL" as Skill,[SQL] as Type form [Data]
union all
select [Group],[ID],"Technical Skill" ,"Shell" ,[Shell] form [Data]
可以简写成:
select Group,ID,"Technical Skill" as Category,"SQL" as Skill,SQL as Type form [Data]
union all
select Group,ID,"Technical Skill" ,"Shell" ,Shell form [Data] |
|