Requirements:
You need to find that a customer has continuously handled the business for those days of a year.
The SQL implementation is as follows::Create a table:Copy codeThe Code is as follows: create table test_num(Tyear number,Tdate );
Test
At the end of last year, a lot of system data migration was conducted. Most of the systems performed logical migration due to platform and version reasons. A few of them performed physical migration and some experiences were made, share with
There are three ways to throw an exception
1. Use the PL/SQL Runtime Engine
2. Use the RAISE statement
3. Call the Stored Procedure RAISE_APPLICATION_ERROR.
When an error occurs during database or PL/SQL running, an exception is automatically
There are two methods:
One is to declare the system cursor, the other is to declare the custom cursor, and then follow the same operation, the parameter type is
In out or out
(1) Declare the personal system cursor. (recommended)
Copy codeThe Code is
Dbms_random is a random function package provided by oracle. The following describes common examples of dbms_random:
Dbms_random.value usage:
Generate a 38-digit decimal number greater than or equal to 0 and less than or equal to 1
Copy codeThe Code
Table query:
Merge query: Use the union keyword to remove duplicate rows that meet the condition.
Copy codeThe Code is as follows: select ename, sal, job from emp where sal> 2500 union select ename, sal, job from emp where job = 'manager ';
Union
Check whether the oracle database is in archive Mode
SQL> select name, log_mode from V $ database;
NAME LOG_MODE------------------------------------------TEST NOARCHIVELOG
SQL> archive log listDatabase log mode No Archive ModeAutomatic archival
Sometimes it is unclear that all the values allowed for some parameters can be obtained by the following two methods:
1. directly enter the error value and let the error prompt
Copy codeThe Code is as follows: SQL> alter system set "_
Oracle provides two listener service registration methods: Dynamic and Static. The status of the dynamically registered service in lsnrctl status is ready, and the static service is unknown.
In versions earlier than 11g2, the listener is configured
Applicability:
When oracle sorts the query results, the column to be sorted has a null value, and the NULL value must be specified at the beginning or end of the column.
Keywords: Nulls First; Nulls Last
Default Value: the default value of null
Many data conversion and processing operations may encounter the need to convert 0.007007040000 to 0.70%. We can use the Oracle SQL function to_char to achieve this conversion.
This function is used to convert the DATE or NUMBER data type to a
1. Static SQL and dynamic SQL Oracle compiler PL/SQL program blocks are divided into two types: one is the early compilation (early binding), that is, the SQL statement has been determined during program compilation, and most of the compilation
After finishing the project yesterday, I asked the test to test it. The test said that paging query does not seem to work. After Turning to page 4th, the data results will be the same.At that time, I was puzzled. It was impossible. The paging
Fault symptom
Oracle Database 11g Database common user login prompt ORA-28002: the password will expire within 7 days
[11: 01: 00oracle @ dvd db_1] $ sqlplus wang/oracle
SQL * Plus: Release 11.2.0.1.0 Production on Fri Nov 16 11:01:23
This article describes how to replace NULL values in SQL Server, Oracle, and MySQL.
In SQL Server Oracle MySQL What should I do if I find a NULL value in the database?
1. MSSQL: ISNULL ()Syntax
Java code
Copy codeThe Code is as follows: ISNULL
Copy codeThe Code is as follows: -- Created on 2010/11/04 by WANGNAN
Declare
-- Local variables here
I integer;
TYPE t_table is table of VARCHAR2 (10) index by VARCHAR2 (2 );
V_t_table t_table;
TYPE t_pg3 is table of asis.
How to deal with the high cpu usage of oracle, this article will introduce the high CPU usage of the oracle process, You Need To Know More friends can refer
1: first, use the TOP command to upload the SPID that occupies the CPU.
PID USERNAME THR PRI
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