--如果存在数据库PRogrammerPay 就删除 if exists (select * from sysdatabases where name='programmerPay') drop database programmerPay go --创建数据库programmerPay create database programmerPay on primary ( name ='programmerPay_data', filename='D:\programmerPay\progra
以下sql是a,b两张表通过关联条件id修改a表值,如果b表有重复数据记录,选第一条更新,红色条件为附加限制条件,具体视情况而定: UPDATE a SETname = b.fname,pwd = b.lnameFROM bWHERE a.id = b.id AND a.id in (2,3) 以下sql为查询单表中重复记录: select * from b t1 where t1.fname in (select t2.fname from b t2 group by t2.fname ha
1,获取当前用户下的所有表信息 => SELECT * FROM user_tables 1.1,查询某一张表的字段信息:SELECT * FROM user_tab_columns where Table_Name = '表名' 1.2,查询某一张表的注释:SELECT * FROM user_tab_comments WHERE Table_Name = '表名' 1.3,查询某一张表中字段的注释:SELECT * FROM user_col_comments WHERE Ta
------在SQL中,将查询的结果创建为新表是如下这样的 select distinct t1.column1,.t2.column2 into table3 from table1.t1 join table2.t2 on(t1.column1=t2.column3); ------在Orale中,完成同样的过程,是这样的 Create table ed as( select distinct e.deptno,d.loc from emp e join dept d on (d.deptn