標籤:SELECT a.areaname as 二級地名 FROM houses h,houses h2,areas a WHERE h.areaid=a.areasid AND h2.areaid=a.areasid AND h.finalassessmentid=1 AND h.houseslevel=2 AND h2.houseslevel=1 AND a.areasid!=a.parentareasid AND a.companysid=2; select * from
標籤:密碼1 conn / as sysdba2 alter user system identified by Abcd1234; manual script first -->manual_script_before_install.sql 1 -- must connect as sysdba to execute the following script 2 -- this manual script is to minimize the
標籤:12、查詢Score表中至少有5名學生選修的並以3開頭的課程的平均分數。select cno,count(cno),avg(degree) from score t group by cno having count(cno)>=5 and substr(cno,0,1)=‘3‘13、查詢分數大於70,小於90的Sno列。select sno,degree from SCORE t where degree>70 and degree
標籤:2016-6-12 22:35:51工作用了一年多的oracle,最近在學mysql, 仔細想想 各種串連,感覺這些概念還是蠻煩人的! 最近整理了一下,分享一下自己的理解,有些東西是借鑒網上並自己吸收了的. 1.不管是什麼串連,oracle和mysql的原理是一模一樣的,只是有些寫法不一樣而已.說到寫法,這裡提一下,select * from A, B where a.filed1=b.filed2; --這是第1種寫法, 內串連,這樣寫,很方便,
標籤:declare cursor city_cur isselect t.new_customer_id,t.old_customer_id from citsonline.crm_customer_tmp6 t where t.new_customer_id!=t.old_customer_idorder by new_customer_id; beginfor my_cur in city_cur loop update platform.crm_service_customer_
標籤:drop table if exists sequence; create table sequence ( seq_name VARCHAR(50) NOT NULL, current_val INT NOT NULL, increment_val INT NOT NULL DEFAULT 1, PRIMARY KEY (seq_name) );drop function if exists
標籤:步驟:1.建立序列 2.建立觸發器。文法解析:create sequence TB_CODE_SEQUENCEminvalue 1maxvalue 999999999999999999999999999start with 11increment by 1cache 10;CREATE OR REPLACE TRIGGER tb_code_Increase BEFORE insert ON tb_code FOR EACH ROW begin