In everyday SQL queries, we need to process the data that we want to query, and then query it in the pre-processed data. At this point we need to use the temporary table, pre-processing the data into the temporary table, and then in the temporary
--Current Date Select To_char (add_months (sysdate, 0), ' yyyy-mm-dd ') Pretoday from dual--last month current date select To_char (Add_months (sysdat E,-1), ' Yyyy-mm-dd ') Pretoday from dual--next month current date SELECT To_char (Add_months
Find an interesting question today,We know that the normal execution of select Sysdate from dual in the Oracle database can return the system time of the current host.When the system time is changed normally, the corresponding query result becomes
a transaction has four characteristics (ACID):atomicity (atomicity)Refers to the entire database transaction is an inseparable unit of work. The entire transaction succeeds only if all operations in the library are successful, and any SQL statement
Renaming a tableFor tables that already exist, you can also modify their names. There are two syntactic forms of renaming a table, oneis to use the ALTER TABLE statement with the following syntax:ALTER TABLE table_name RENAME to new_table_name;The
Query Undo Table Space StatusSELECT SUM / 1024x768 / 1024x768 from GROUP by tablespace_name, status;The state of the undo tablespace (status) has three values-------active, EXPIRED, unexpired, what they mean: active: The undo Tablespace area
--Create UserCreate user QJT identified by 1234--PermissionsGrant Connect to QJTGrant resource to QJT--Build a tableCREATE TABLE UserInfo(ID number primary key NOT NULL)--Query with several tablesSELECT * from All_tables where owner= ' QJT '--Pseudo-
Note the point:1, the Update main table must be added filter conditions.2, the query to update the result set, but also to be updated as the main table conditions, as the synchronization of everyone is to update this part of the data.Update Student
Manually deleting an Oracle database user often occurs when the session process is still in use causing the deletion to fail. It is inconvenient to query the session and delete the session to successfully delete the database user.Applicable
Oracle Flashback Technologies-Estimating the amount of flash logs generated at different time periodsV$flashback_database_statA statistic that monitors the I/O overhead of the flashback data and estimates the flashback space requirement based on the
System environment:CentOS Release 6.7 (Final)Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bitOperation Process:1. When you add a data file or create a tablespace, you specify the path as a single-node localSql> alter tablespace users
Use Rman to flash back to the database according to the specified SCN#查看可以闪回到多久前Sql> select * from V$flashback_database_log;#查看当前的SCNSql> select Current_scn from V$database; CURRENT_SCN----------- #关闭数据库$ rman target/recovery manager:release 11.2.
1. Log in to Oracle as DBA2, create user, users-->new ... Enter user name and password3, give Connect/resource role4, give the user permissions on the view operation the following 3 sentences SQL--Create View permissions, generally on the internet
1. Basic SELECT statement1) View Current userShow UserUSER is "SCOTT"2) Query the table under the current userSql> select * from tab;Tname Tabtype Clusterid------------------------------ ------- ----------DEPT TABLEEMP TABLEBONUS TABLESalgrade TABLE3
1 sql>-- string case sensitivity 2 sql>-- query the employee named King 3 sql> SELECT * 4 C6/>2 from emp 5 3 where ename = ' KING '; 6 7 sql>-- date format sensitive 8 sql>--Query the entry date is 1 July-November-81 of employees 9 sql> SELECT
simple usage of substr functions in OracleSUBSTR (string, intercept start position, intercept length)//return intercepted wordsubstr (' Hello World ', 0, 1)//return result is ' H ' * start with a string of length 1 from the first charactersubstr ('
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service