--Start
First, we prepare the test data.
CREATE TABLE TEST
(
NAME VARCHAR2,
birthday DATE
);
INSERT into TEST VALUES (' John ', DATE ' 2014-12-14 ');
INSERT into TEST VALUES (' Dick ', DATE ' 2013-12-14 ');
INSERT into TEST VALUES (' Harry ',
C # code
String sql = string. Format (@ "BEGIN UPDATE t SET content= ' 2" WHERE oid= ' 1 '; IF sql%rowcount = 0 THEN INSERT into T (oid,content) VALUES (' 1 ', ' 2 ') ); End IF; End; " ); Sqlhelper.executenonquery ("CONNECT", CommandType.Text, SQL);
Table structure:
Name Subject Score
John Language 89
John Math 73
Dick Language 73
Dick Math 73
Required Format:
Name Subject Score
John Language = 89, digital =73
Dick language = 73, digital =73
Query statement:
Select Name, Wm_concat (to_char) (
Set linesize set long 100000 set wrap on col "Create_user_ddl" for a200 wrapped word define username= "' VINCENT '"--Modify
UserName, query other existing account Select DBMS_METADATA.GET_DDL (' USER ', &username) ' Create_user_ddl ' from dual;
difference between on condition and where condition in Oracle left join
The on condition in the join is the same as the where condition, while the left join is not the same
Sql> CREATE TABLE T1 as select * from Scott.emp;
Table has been
For example, the following command is slow to executeThe following is a code fragment:Select A.empno from emp A where a.empno does not(select Empno from Emp1 where job=′sale′);If you are using an outer join, rewrite the command as follows:The
Trunc (sysdate-to_date (' 2003-10-25 ', ' yyyy-mm-dd '))
Select Trunc (to_date (string1, ' yyyy-mm-dd ')-to_date (string2, ' Yyyy-mm-dd ')) from dual;
The Sybase function DateDiff () is used in SQL to replace the function with an error executing in
Manually start an ORACLE database instance assume that the instance name ORCL first export the environment variable in the configuration file or set ORACLE_SID=ORCL sqlplus Sys/password as Sysdba sql>startup; The startup command reads the
1. Database Configuration
First of all, your installation database, which is installed here is Oracle, does not explain.
Open the Web-inf/config/systemglobals.properties file, locate the configuration parameters database.driver.name and configure
This morning, the user called to say that the system has a problem with the sorting, look carefully, the problem seems to be out of rownum this function.
The RowNum function in Oracle is to assign an increment to the query result in order, so many
Oracle exists problems are frequently encountered when learning Oracle, and this will address the Oracle exists solution. Oracle uses a complex, self-balanced b-tree structure. In general, querying data through an index is faster than full table
Take Oracle Database for example
1 use of exists
exists is used only for subqueries, can be substituted in, and if matched to result, exit internal
query, and returns the entire result data with the condition flag to true, in whether or not the
How to create a new self-column in Oracle, in general, you need to build a sequence and pay the sequence to a column to rebuild the trigger.
First, open PD15, create a new PDM document, and create a new one, as shown in the figure:
The second
You're still struggling to figure out how to quickly count the total number of records in a table with lots of data.
Are you still using SELECT COUNT (*) from table_name?
I can try my new discovery:
Direct COUNT (*) is time-consuming when you
Today, when I helped my classmate install Oracle, I found an error (SID already exists), and here's the solution:
1, Start-> Settings-> Control Panel-> Management Tools-> ServicesStop all Oracle Services.
2, Start->
Oracle Start listening Service
Lsnrctl start
Stop the Listening service
Lsnrctl stop
Ora-12514:tns: The listener is currently unable to recognize the service requested in the connection descriptor
Need to configure Listener.ora files in Oracle
Approximate process.
Oracle Log Analyzer Tool Logminer use
1. Set Date format
Alter system set nls_date_format= ' Yyyy-mm-dd hh24:mi:ss ' scope=spfile;
Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') from dual;
2. Add Supplemental Log
If the
RowNum is a pseudo column that Oracle has provided from 8, numbering the results of SQL, always starting at 1, with the common use of paging output.
Like what:
SELECT * from table_temp t WHERE rownum
SELECT * FROM (select A.*, rownum rn
Original URL: http://blog.sina.com.cn/s/blog_7e4ac8b50100vcwv.html
Parsing and execution order of the SQL condition field (Where part) [Right--> left]Experiment one: It is proved that the parsing of SQL is from right to leftThe following experiment
DBA View
Serial number
1
Dba_data_files
Information about the database file
2
Dba_db_links
All database links in the database
3
Dba_extents
Include all partitions in
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