zoukankan
html css js c++ java
sql 语句
declare
@strtrannote
nvarchar
(
100
);
declare
@strlocation
nvarchar
(
100
);
declare
@tempstr
nvarchar
(
100
);
set
@strtrannote
=
'
a*b*
'
;
set
@strlocation
=
'
1*2*
'
;
set
@tempstr
=
@strlocation
DECLARE
@Index
int
;
DECLARE
@Left
nvarchar
(
50
);
WHILE
CHARINDEX
(
'
*
'
,
@strtrannote
)
>
0
--
返回字符串中指定表达式的起始位置
BEGIN
SELECT
@Index
=
CHARINDEX
(
'
*
'
,
@strtrannote
);
--
返回字符串中第一个"&"的起始位置
SELECT
@Left
=
LEFT
(
@strtrannote
,
@Index
-
1
);
--
从左边开始,取得字符串左边指定个数的字符(第一个值)
--
update TranNote set packlist_id=@packlist_id where TranNotekey=@LEFT and website=@website;
DECLARE
@Index2
int
;
DECLARE
@Left2
nvarchar
(
50
);
set
@strlocation
=
@tempstr
WHILE
CHARINDEX
(
'
*
'
,
@strlocation
)
>
0
--
返回字符串中指定表达式的起始位置
BEGIN
SELECT
@Index2
=
CHARINDEX
(
'
*
'
,
@strlocation
);
--
返回字符串中第一个"&"的起始位置
SELECT
@Left2
=
LEFT
(
@strlocation
,
@Index2
-
1
);
--
从左边开始,取得字符串左边指定个数的字符(第一个值)
print
(
@left
);
print
(
@left2
);
SELECT
@strlocation
=
REPLACE
(
@strlocation
,
@Left2
+
'
*
'
,
''
);
--
将左边已经取出的部分替换为空
END
SELECT
@strtrannote
=
REPLACE
(
@strtrannote
,
@Left
+
'
*
'
,
''
);
--
将左边已经取出的部分替换为空
END
显示结果:
a
1
a
2
b
1
b
2
继续追寻。。。。。。
查看全文
相关阅读:
OAF[1]开发环境的配置
XAF如何开始学习XAF
XPO开发指南简要
XAF 如何使用AlertControl?
企业邮箱及邮件服务器架设
Excel的SUM函数9种公式设置
XAF 如何显示非持久类数据列表
分上下半月统计 SQL
XAF中实现类型转换(ValueConverter)
在XAF中如何自定义用户、角色、权限、资源、事件(复杂权限)
原文地址:https://www.cnblogs.com/lfzwenzhu/p/1332905.html
最新文章
ios判断用户设备
内存管理中switch的使用
判断iphone ipad 设备上的相机是否可用
解决5.0 以下版本自定义 navigationBar 背景图片(the backgroud of the Bar)
向导航栏 添加提示
关于showModalDialog 的常见问题
企业网站常用中英文对照表
编写适合于自己的代码生成器 (转刚才首页上的,怕以后找不到)
做网站和做系统
用htmlagilitypack分析导出简历
热门文章
我居然彻夜未眠!
看别人减肥(转自http://www.cnblogs.com/hustlxjaw/)
51干什么,还没有想好。
联通8999发来的短信,有点意思
凌晨三点,谁还在园子里挂着?
Oxite分析之结构浅析
如何得知concurrent program执行log以及output
如何通过修改DB来添加responsibility
Oracle EBS中PO的类型介绍
AR中Transaction画面提示错误Please correct the receivable account assignment
Copyright © 2011-2022 走看看