我想查詢,但它是不正確的。使用連接的情況下sql
我想要做的是申請加入的情況下
我查詢
SELECT LEFT(Student_First_Name,LEN(Student_First_Name)-LEN(Name_Lookup_Table.Dirty_Name)),Name_Lookup_Table.Dirty_Name, Name_Lookup_Table.Standard_Name
case
when Transformed_All_Student.Student_First_Name like '% '+Name_Lookup_Table.Dirty_Name
then
from Transformed_All_Student left join Name_Lookup_Table
on Transformed_All_Student.Student_First_Name like '% '+Name_Lookup_Table.Dirty_Name
when Transformed_All_Student.Student_First_Name like '% '+Name_Lookup_Table.Dirty_Name+'%'
then from Transformed_All_Student left join Name_Lookup_Table on Transformed_All_Student.Student_First_Name like '% '+Name_Lookup_Table.Dirty_Name+'%'
when Transformed_All_Student.Student_First_Name like Name_Lookup_Table.Dirty_Name+'% '
then from Transformed_All_Student left join Name_Lookup_Table on Transformed_All_Student.Student_First_Name like Name_Lookup_Table.Dirty_Name+'% '
誰能幫助?
其工作完全正常:) :)三江源現在 – ssbb
我想從學生名字修剪dity_name與Standard_Name更換。實際上,我有一個名爲「Name_Lookup_Table」的查找表,其中包含字段Standard_name和dirty_name ,如代碼 tas.Student_First_Name like'%'+ nlt.Dirty_Name – ssbb