名字或姓氏大小写更改查询不会产生意想不到的后果。

发布于 2025-01-07 11:17:12 字数 240 浏览 3 评论 0原文

我正在 Sybase 应用程序中运行下面的查询,效果很好,但结果是当名字写成这样时,“ADNAN RAZA”就变成了“Adnan Raza”。我可以在这里使用的任何函数来检测空格或 - 后字母的位置并更新。无法手动完成,有超过 100k 条记录。

update master set firstname = 
upper(left(firstname,1))+lower(substr(firstname,2));

I am running the query below in Sybase application which works great but the consequences are when the first name is written like this, "ADNAN RAZA" it makes it "Adnan raza". Any function which I can use here to detect the position of letter after space or - and update. Can't do it manually there are more than 100k records.

update master set firstname = 
upper(left(firstname,1))+lower(substr(firstname,2));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

为你拒绝所有暧昧 2025-01-14 11:17:12

在Oracle SQL中有一个名为initcap(字符表达式)的函数。
Initcap 返回字符表达式,每个单词的第一个字符为大写,其余字符为小写。
我在 Sybase 的某个地方看到有 dbo.intcap(name) 用于此目的。

in Oracle SQL there is a function called initcap (character-expression).
Initcap returns character- expression with each word's first character in uppercase and the rest in lowercase.
i saw somewhere that in Sybase you have dbo.intcap(name) for this.

梦毁影碎の 2025-01-14 11:17:12

目前在数据库级别没有解决方案。

There is no solution for this at db level as it stands now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文