標籤:--去重查詢方法一:根據idselect * from sxe where id in(select min(id) from sxe group by username) order by id asc;--去重查詢方法二:根據rownumselect * from (select s.*,rownum rn from sxe s ) x where x.rn in (select min(rownum) from sxe group by username) order by id
標籤:insert into demo select * from demo as of timestamp to_date(‘2015-11-16 12:30‘,‘yyyy-mm-dd hh24:mi‘)查詢到表某個時間的資料, 然後插入。 其他的sql語句:select current_scn from v$database;select * from chg_invoice_cancel as of timestamp sysdate-5/24/60; &
標籤:擷取表欄位:select * from user_tab_columns where Table_Name=‘使用者表‘ order by column_name擷取表注釋:select * from user_tab_comments where Table_Name=‘使用者表‘order by Table_Name擷取欄位注釋:select * from user_col_comments where Table_
標籤:create or replace procedure sp_addProjectQj( ret out number, flowid in number --流程Id) ascursor c_design is select * from LC_VR_Detail where lc_crm_visitreport_Id = flowid and dd_status != 2; c_row c_design%rowtype; v_id number;begin
標籤:一、建立資料1.1、建立表與插入資料CREATE TABLE DISTRICT( ID NUMBER(10) NOT NULL, PARENT_ID NUMBER(10), NAME VARCHAR2(255 BYTE) NOT NULL);ALTER TABLE DISTRICT ADD ( CONSTRAINT DISTRICT_PK PRIMARY KEY (ID));ALTER TABLE