例如student表: studentID studentName studentScore 01 Alice 90 02 Bill 95 03 Cindy 100 一.拼接多个字段的值 select studentID+‘-’+studentName+'-'+studentScore AS studentInfo from student 结果: 二.一个字段多条记录的拼接 select stuff((select '|'+studentName from student for xm
如student表: studentID studentName studentScore 01 Alice 90 02 Bill 95 03 Cindy 100 一.拼接多个字段的值 select studentID+‘-’+studentName+'-'+studentScore AS studentInfo from student 结果: 二.一个字段多条记录的拼接 select stuff((select '|'+studentName from student for xml p
select * from [dbo].[Sys_MemberKey] a where exists(select * from [Sys_MemberKey] b where a.FMachineCode<>'' and a.FKeyID=b.FKeyID and a.FMemberID<>b.FMemberID) 一个相同的表根据一个字段,查找另外一个字段不相同值,经测试可用
mySql中,升序为asc,降序为desc.例如: 升序:select * from 表名 order by 表中的字段 asc(mysql中默认是升序排列,可不写) 降序:select * from 表名 order by 表中的字段 desc 若要进行同时一个升序,一个降序,则如下: order by 升序字段 asc,降序字段 desc.
转眼间,这一年又结束了,再记录一点知识吧 同事说他有好多shapefile,想给每个shapefile添加一字段,并设置该字段的内容为shapefile文件名,想着用arcpy实现,于是有了下面的代码 import os import arcpy arcpy.env.workspace = r"F:\workspace\2017\other" fcs = arcpy.ListFeatureClasses() for fc in fcs: arcpy.AddField_managemen
ORDER BY _column1, _column2; /* _column1升序,_column2升序 */ ORDER BY _column1, _column2 DESC; /* _column1升序,_column2降序 */ ORDER BY _column1 DESC, _column2 ; /* _column1降序,_column2升序 */ ORDER BY _column1 DESC, _column2 DESC; /* _column1降序,_column2降序 */
1.增加一个字段 alter table user add COLUMN new1 VARCHAR(20) DEFAULT NULL; //增加一个字段,默认为空 alter table user add COLUMN new2 VARCHAR(20) NOT NULL; //增加一个字段,默认不能为空 www.2cto.com 2.删除一个字段 alter table user DROP COLUMN new2; //删除一个字段 3.修改一个字段 alter table user MOD