ZKX's LAB

sql2000 求余数 怎样在SQL中进行计算?

2021-04-09知识5

求sql2000 语句将列名为值。 只能用楼上的 那种方法最多也就是动态处理一下declare@Sql varchar(8000)declare@i intdeclare@ColName varchar(255)set@i=1set@Sql=''while Exists(select*from syscolumns where id=object_id('TEST')and colorder=i)beginselect@ColName=name from syscolumns where id=object_id('TEST')and colorder=iset@Sql=Sql+'union all select '''+ColName+''' as 名称,cast('+ColName+' as varchar(100))as 值 from TEST 'set@i=i+1endset@Sql=right(@sql,len(@sql)-9)set@Sql=stuff(@Sql,1,10,'')print@Sqlexec(@sql)sqlserver2005里 还有一个操作是unpiot,你可以查查帮助不过实现起来也得这么做

求SQL2000问题 1:update job set begin time='2003-01-01 10:00:00' where begin time='2001-02-11 19:49:00'2:1)select*from employee;2)select top 10 fname from employeegroup by fname order by fname3)select*from employeewhere between ID=31 and ID=40这个基本我都试了可以的sql server 和orcale 语句都这么写的

求SQL2000语句 将B表中存在,C表中不存在的ID插入C表就行了,语句如下:INSERT INTO C(ID)SELECT DISTINCT ID FROM BWHERE ID NOT IN(SELECT ID FROM C);

#sql2000 win732安装不上#sql2000 求余数

随机阅读

qrcode
访问手机版