我需要在Alteryx Designer中编写SQL代码的帮助。
我的表employees
包含列Name
,其值如下所示。但是,我需要如下所示的预期输出。
请帮助。
名称:
- Smith, Mary K
- Koch, J B
- Batoon Rene, Anne S
- Vaughan-tre Doctor, Maria S
除外输出:
玛丽史密斯- ,
- 科赫J
- Batoon Rene, Anne
- Vaughan-tre,玛丽亚
中间的首字母缩写和"Doctor"字去掉。
不知道为什么你需要使用SQL,如果你有Alteryx的数据?
那么,您需要从每个记录中删除右手2个字符和单词"Doctor"?
你可以使用公式工具,但我怀疑还有许多其他方法:
replace (TrimRight([Name],' '+right([Name],1)),'Doctor','')