SQL 过程一个小问题·!

来源:百度知道 编辑:UC知道 时间:2024/05/12 07:41:44
已知字段A=“百度最大的中文搜索引擎”
已知字段B=“百度中文引擎”

写一过程A得到(A-B)的结果其余字符(最大的搜索)

在线等
如果SQL过程无法实现A-B的结果

用C# 程序实现也行,不过最好写清楚

测试过了 接分
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
String a = "abdcefessd";
String b = "ad";
char[] brr = b.ToCharArray();
for (int i = 0; i < b.Length; i++)
{
while (a.Contains(brr[i]+""))
{
a = a.Replace(brr[i] + "", "");
}
}
Console.Write(a);
}
}
}

真的很复杂耶,不过可以给你个思路
用VBScript实现吧
要用instr判断B里的所有字符是否在A里存在,如果存在的话则从A里删除,最后得到A-B结果
祝你成功

来学习的

SQL 2000 查询分析器下测试通过
==========================================================
begin
declare @a as varchar(100) ,@b