SQL Server 2005报了这么个错:Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "Chinese_PRC_90_CI_AS" in the like operation.
后查证,这是由于两个做比较的列的排序方式不同,中文有很多种排序方式,对应如下:
中文(香港特别行政区)
Chinese_Hong_Kong_Stroke_90_CI_AS
中文(香港特别行政区)
Chinese_Hong_Kong_Stroke_90_CI_AS
中文(澳门特别行政区)
Chinese_PRC_90_CI_AS
中文(中国)
Chinese_PRC_CI_AS
中文(中国)
Chinese_PRC_Stroke_CI_AS
中文(新加坡)
Chinese_PRC_90_CI_AS
中文(台湾)
Chinese_Taiwan_Stroke_CI_AS
中文(台湾)
Chinese_Taiwan_Bopomofo_CI_AS
修正错误只需要在列名后面加上“COLLATE Chinese_PRC_CI_AS”就可以了,例如:
select * from table1, table2
where table1.column1 COLLATE Chinese_PRC_CI_AS=table2.column2 COLLATE Chinese_PRC_CI_AS ......
一、如何从select的查询结果中再次运算?
第一步:
粗查询。首先需要将第一层查询弄对,关系弄清楚。
select sum(quantity) total ,price_water,price_pollute from pay_water where time_pay >='2010-02-01 00:00:00.000' and time_pay <'2010-02-28 23:59:59.000'
group by price_water,price_pollute
第二步:
二次查询。在一次查询的基础上进行运算。
select total*price_water a ,total*price_pollute b from (
select sum(quantity) total ,price_water,price_pollute from pay_water where time_pay >='2010-02-01 00:00:00.000' and time_pay <'2010-02-28 23:59:59.000'
group by price_water,price_pollute
) as test
as test是必须有的,没有就会报错。
第三步:
压缩:
select sum(total*price_water) a ,sum(total*price_pollute) b from (
select sum(quantity) total ,price_water,price_pollute from pay_water where time_pay >='2010-02-01 00:00:00.000' and time_pay <'2010-02-28 23:59:59.000'
group by price_water,price_pollute
) as test
sum()函数可以将上下压缩,求出该列的总和。
二、grou ......
a b c d
980515 精頂企業有限公司 簡家豪 NULL
980514 全欣木業有限公司 NULL 123
980514 迅億科技股份有限公司 簡逢浚 NULL
980515 聖越國際企業有限公司 NULL   ......
1、Session有什么重大BUG,微软提出了什么方法加以解决?
答:是iis中由于有进程回收机制,系统繁忙的话Session会丢失,可以用Sate server或SQL Server数据
库的方式存储Session不过这种方式比较慢,而且无法捕获Session的END事件。
2.产生一个int数组,长度为100,并向其中随机插入1-100,并且不能重复。
C# code
int[] intArr=new int[100];
ArrayList myList=new ArrayList();
Random rnd=new Random();
while(myList.Count<100)
{
int num=rnd.Next(1,101);
if(!myList.Contains(num))
myList.Add(num);
}
for(int i=0;i<100;i++)
intArr[i]=(int)myList[i];
Random r = new Random();
List<int> iNumberList = new List<int>();
int i = r.Next(1, 100);//第一个数不可能重复 所以先把它添加进去
iNumberList.Add(i);
while (iNumberList.Count < 100)
{
while (iNumberList.Contains(i))
{
i = r.Next(1, 101);
}
iNumberList.Add(i); ......
1. 简述 private、 protected、 public、 internal 修饰符的访问权限。
答 . private : 私有成员, 在类的内部才可以访问。
protected : 保护成员,该类内部和继承类中可以访问。
public : 公共成员,完全公开,没有访问限制。
internal: 在同一命名空间内可以访问。
2 .列举ASP.NET 页面之间传递值的几种方式。
答. 1.使用QueryString, 如....?id=1; response. Redirect()....
2.使用Session变量
3.使用Server.Transfer
3. 一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30位数是多少, 用递归算法实现。
答:public class MainClass
{
public static void Main()
{
Console.WriteLine(Foo(30));
}
public static int Foo(int i)
{
if (i <= 0 ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......