1.在表emp中新增字段sexy(性别) alter table emp add sexy varchar2(2); 新增多个字段cxx 和shoneworn alter table emp add (cxx varchar(2),shoneworn varchar(2)); 2.在表emp中删除一个字段 sexy alter table emp drop column sexy; 删除多个字段 alter table emp drop (cxx, shoneworn); 3.修改字段名 al
sql某一表中重复某一字段重复记录查询与处理 1.查询出重复记录 select 重复记录字段 form 数据表 group by houseno having count(重复记录字段)>1 2.重复记录只显示一条ID值最小或最大的记录 select id,* from 数据表 where houseno (select 重复记录字段 form 数据表 group by 重复记录 字段 having count(重复记录字段)>1 ) 这样把houseno重复的的ID值全部显示
sql server 关于表中只增标识问题 由于我们系统时间用的过长,数据量大,设计是采用自增ID 我们插入数据的时候把ID也写进去,我们可以采用 关闭和开启自增标识 没有关闭的时候 ,提示一下错误,不能修改 set identity_insert test on 关闭标识 在添加时候 提示成功 set identity_insert 表名 on 关闭 set identity_insert 表名 off 开启 C# 实现自动化打开和关闭可执行文件(或 关闭停止与系统交互的可执行文
MySQL修改表中字段的字符集 ALTER TABLE 表名 MODIFY 字段名 要修改的属性: 例:ALTER TABLE `guaduates` MODIFY `studentno` CHAR(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; 扩展:修改表的字符集 ALTER TABLE 表名 要修改的属性: ALTER TABLE `guaduates` CHARSET=utf8;