update s set s.classbid = lc.itemidfrom dbo.Lv_servers as s INNER JOIN dbo.Lv_LineChannel as lc ON s.Classsid = lc.ClassId where s.classbid >0 SQL用另外一个表的数据更新本表数据,两个表的关系要写在from的后面表的别名也要写在这里,写在update后面是不行的,update后面跟着要更新的表,至于同时更新两表的数据暂时没有用过就 不知道了. 更新
应用场景:将数据表TB_USER中字段NNDP的内容中为[sannanyinv]转换为[3男1女] 主要脚本:一个游标脚本+分割字符串函数+拼音转数字脚本 操作步骤如下: 1.创建类型 create or replace type splitTable is table of varchar2(100); 2.创建函数fn_splitString(功能是将字符串分割成多条记录)--测试语句select * from table(fn_splitString('ernanyinv','nan'))
转自 :http://gis-conquer.blog.sohu.com/170243422.html 查询所有表名:select t.table_name from user_tables t; 查询所有字段名:select t.column_name from user_col_comments t;查询指定表的所有字段名:select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';查询指定
查询所有表名:select t.table_name from user_tables t;查询所有字段名:select t.column_name from user_col_comments t;查询指定表的所有字段名:select t.column_name from user_col_comments t where t.table_name = 'BIZ_DICT_XB';查询指定表的所有字段名和字段说明:select t.column_name, t.column_name from
oracle表结构和表内容差异比对 oracle中有三种集合操作,他们会把左边和右边的select 结果集进行集合操作. union 并集 intersect 交集 minus 差集 假设有如下两张表 STUDENT_A 和 STUDENT_B create table STUDENT_A ( id ) not null, name ), age NUMBER, sex ) ); insert into STUDENT_A (id, name, age, sex) , '); insert in