Recently, derivative work is required to import data from several tables to one table, where data may be duplicated. Therefore, data comparison is required before import.
Method 1: I used group by having count (*)> 1 to extract the duplicate data
1. Date interval operation
Current Time minus 7 minutes
Select sysdate, sysdate-interval '7' minute from dual
Current Time minus 7 hours
Select sysdate-interval '7' hour from dual
Current Time minus 7 days
Select sysdate-interval '7' day
The new oracle11g database was used yesterday.
It was a relatively simple problem. I should have done something about configuring TNS and modifying connectstring.
Who knows? A user name and password error is reported as soon as the database is
1. Connection sequence in the WHERE clause: Oracle uses the bottom-up sequence to parse the WHERE clause. According to this principle, the join between tables must be written before other where conditions, and those conditions that can filter out
1. view the table space name and size.
Select t. tablespace_name, round (sum (bytes/(1024*1024), 0) ts_size
From dba_tablespaces t, dba_data_files d
Where t. tablespace_name = d. tablespace_name
Group by t. tablespace_name;
2. view the name and
Working overtime today, we found that all oracle services on the database server were lost-that is, there were no oracle services in the Service Manager, such as OracleOraDb10g_home1TNSListener and OracleServiceORCL.Solution:1. Export all oracle
Two days ago, when installing Oracle 10g, I encountered the problem of "Microsoft LoopBack Adapter configured as the system's primary network Adapter", and found other solutions on the Internet, the following is a summary:
Stop the current "Local
I. Oracle Data Dictionary
A data dictionary is a place where Oracle stores database information. It is used to describe data. For example, the Creator information, creation time information, tablespace information, and user access permission
1. Connection:
1. equijoinDikar set connectionSelect ename, A. deptno as a_deptno, B. deptno as B _deptno, B. dname as departmentFrom emp a, DEPT BEquijoinSelect ename, A. deptno as a_deptno, B. deptno as B _deptno, B. dname as departmentFrom emp a,
Since there are not many contacts with Oracle and there are few training companies, such a company is just a scam. It is estimated that there is no great development!Let's get down to the truth.I have debugged a program that executes Oracle
0. database parameter attributesCol PROPERTY_NAME format a25Col PROPERTY_VALUE format a30Col DESCRIPTION format a100Select * from database_properties;
Select * from v $ version;
1. Find the SID of the current session, SERIAL #SELECT Sid, Serial #
How to remotely determine
Oracle
DatabaseOf
InstallPlatform
Select * from v $ version;
View table space usage
Select sum (bytes)/(1024*1024) as free_space, tablespace_nameFrom dba_free_spaceGroup by tablespace_name;
Select a. TABLESPACE_NAME, A.
Analysis Function over and Window Function
I. analysis function overOracle provides analysis functions starting from 8.1.6. analysis functions are used to calculate a group-based aggregate value. What is different from aggregation
A few months ago, I was confused and changed the machine name from "south" to "southyj ". It took a long time to discover that Oracle cannot be used. Check the cause. It turns out that when Oracle is installed, the directory will be generated based
In the new year, I summarized some of the books I have read before. Many of them are worth reading and reading, and many are also sleepy after several pages.
Below are some books related to databases that I think are good at. I can't wait to share
--- 1. Normal equal connections
Select E. last_name, D. department_name
From employees e, departments d
Where E. department_id = D. department_id;
--- 2 left Outer JoinSelect E. last_name, E. department_id, D. department_nameFrom employees eLeft
Create or replace trigger testTAFTER INSERT OR UPDATE OR DELETE ONFor each rowDeclare-- Local variables hereBeginIF INSERTING THENInsert into B (a, B) VALUES (: NEW. a,: NEW. B );ELSIF DELETING THENDelete from B WHERE a =: OLD.;ELSEUPDATE B SET B =:
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