SQL 以逗号分隔查询;调用自定义函数
2024-09-24 12:57:39
select col from [dbo].[GetInPara]('101,102,103',',')
USE [xxx]
GO
/****** Object: UserDefinedFunction [dbo].[GetInPara] Script Date: 2019/9/26 11:06:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER function [dbo].[GetInPara](@c varchar(),@split varchar())
returns @t table(col varchar())
as
begin
while(charindex(@split,@c)<>)
begin
insert @t(col) values (substring(@c,,charindex(@split,@c)-))
set @c = stuff(@c,,charindex(@split,@c),'')
end
insert @t(col) values (@c)
return
end
最新文章
- php报表使用
- 解决ArcGIS安装之后出现的Windows installer configures问题
- 第二章 编写与设置Servlet
- AJAX-----14HTML5中新增的API---files
- jQuery 1.9 .live() is not a function
- 网页自适应@media
- Android开发-API指南-Content Provider基础
- 动态生成图片 保存到OutputStream
- 2014广州Java岗位面试汇总
- Installshield: custom action return value
- android使用Genymotion作为模拟器
- select函数的简单使用
- Linux-中断和中断处理
- asp.net时间范围查询
- k8s与云服务器之间服务互访之节点网络打通
- c#无边框窗体移动
- 如何使tinymce编辑器的高度随内容自变化(转载)
- Arduino IDE for ESP8266 项目云盒子(4)组网
- Rocket MQ 问题排查命令
- mac下的tcp抓包
热门文章
- P2077 【红绿灯】
- 【Angular5】 返回前一页面 go back to previous page
- 联盟周赛2019810 csgo (动态规划、不下降子序列)
- Hbase 0.92.1 Replication
- [题解][洛谷]_U75702/P5462_X龙珠_论何为字典序
- GitHub编辑README.md
- 优雅的用两种方式爬网络 txt 文件【雾
- filebeat开启自带模块收集日志如何辨别日志来源等
- [WPF]BringIntoView
- Ubuntu安装openssh安装ssh、 免密登录、 创建新用户并免密登录