由于空格而将重复的大学名称插入数据库 [英] Duplicate college names inserting into database because of spaces

查看:61
本文介绍了由于空格而将重复的大学名称插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我正在将excel工作表导入数据库表,但是在大学详细信息中,存在相同的大学名称,但是由于空格和.(点),它考虑了新的大学名称.
我不想插入重复的大学.
租赁帮助我...

Hello friends,

I''m importing the excel sheet to database table,but in college details same college name is there but because of spaces & .(dots) ,its considering the new college name.
I don''t want to insert duplicate colleges.
lease help me...

推荐答案

你好,

尝试修剪空格(rtrim/ltrim)并替换(点)导入到较新的表中.
请参见下面的示例语法;

-导入临时表;表1
-清理(带有修剪和替换)并使用distict关键字写入新表中,以消除出现的重复项.

Hello,

Try trimming out the spaces (rtrim/ltrim)and replacing (the dot) the imported into a newer table.
See sample syntax below;

- import into a temp table; table 1
- clean (with trim and replace) and write to a new table with distict keyword to remove duplicates occurring.

select distinct replace(rtrim(ltrim(var1)),'.',''), other columns INTO Permanent_Table From Table 1



希望对您有帮助,祝您好运.

Ali J



Hope this helps, good luck.

Ali J


从大学名称列中输入所有不同的值,并将对应的专有名称插入新表中.然后使用该表与ur数据联接并获得正确的名称.....这样可以解决拼写错误....

谢谢
Put all distinct values from college names columns and insert proper name against it into new table. Then use that table to join with ur data and get the proper name.....In this way spelling mistakes can be covered....

Thanks


这篇关于由于空格而将重复的大学名称插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆