易截截图软件、单文件、免安装、纯绿色、仅160KB

求SQL语句。

表partInfo
ID partType
--------------------------
pt001 A1
pt001 A1/A2
pt002 B1
pt002 B2
-------------------------
要求结果
ID partType
--------------------------
pt001 A1/A2
pt002 B1/B2
给个说明或方法,结果怎么来的?

create function f_str(@id varchar(10))
returns varchar(1000)
as
begin
  declare @s varchar(1000)
  select @s = isnull(@s+'/','')+case when charindex('/'+parttype+'/','/'+@s+'/')>0 then '' else parttype end from partinfo where id = @id
  return @s
end
go

select id,dbo.f_str(id)
from from partinfo 
group by id

引用
create function f_str(@id varchar(10))
returns varchar(1000)
as
begin
declare @s varchar(1000)
select @s = isnull(@s+'/','')+case when charindex('/'+parttype+'/','/'+@s+'/')>0 then '' else pa……


速度太快了

不行,还是先折分

SQL code:
----------------------------------------------------------------
-- Author :fredrickhu(小F,向高手学习)
-- Date :2010-04-02 16:47:45
-- Verstion:
-- Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86)


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

ASP链接SQL的简单登陆界面 - .NET技术 / ASP.NET

protected void btnLogin_Click(object sender, EventArgs e)
  {
  SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......

如何使用MySQL - MS-SQL Server / 基础类

刚刚接触MySQL,不知道该如何去查看数据,插入数据,创建数据库、表,用哪为前辈能指教一二?

MySQL 5.1参考手册

引用
兄弟你会结贴吗?
mysql 参考手册

baidu

MySQL官方文档 http://dev.mysql.com/doc ......

执行sql - PowerBuilder / 数据库相关

update test set qty = qty - 1 where (location,sku,valid_date) 
in (select location,sku,min(valid_date) from test
where location = 'chuwei' and item_code = '5678' group by location,sku)
以上语 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号