本文介绍了如何将一行与整个列值匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在表格中有以下数据
DepartmentName
IT
软件
技术
技术
如何获得以下格式的数据
DepartmentName Department_Match
IT软件
IT技术
IT技术
i have below data in table Department
DepartmentName
IT
SOFTWARE
TEchnology
Technical
how can i get the data in the below format
DepartmentName Department_Match
ITSOFTWARE
ITTEchnology
ITTechnical
推荐答案
SELECT 'IT' AS [Department Name], DepartmentName AS Department_Match FROM Department
WHERE DepartmentName != 'IT'
这篇关于如何将一行与整个列值匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!