I'm dizzy. It's really concise to add this one.
Private void displaybutton_click (Object sender, system. eventargs E){// Clear the data in listviewListview1.items. Clear ();
// Establish a data connectionOracleconnection conn
Step 1: query the table ID from the data dictionary View
Select object_id from all_objects where owner = 'sunard' and object_name = 'tbl _ wdc_inf ';
Step 2: Identify the order of all fields in the table by ID
Select OBJ #, Col #, name from SYS.
1. Write a connection directly in a fixed way in a Java class, for example:
Import Java. SQL. connection; import Java. SQL. drivermanager; import Java. SQL. sqlexception;/*** encapsulate Common Database Operations * @ author administrator
-Basic connection operations
Sqlplus scmgt/scmgt as sysdba connect to the Oracle database // scmgt
Sqlplus "scmgt/scmgt @ testdb" connects to another databaseSelect name from V $ database; view the current database nameSelect table_name from all_
Group and sort multiple data and obtain the first record in each group.
SQL code
Select *
From (select row_number () over (partition by order by DESC) lev,
.*
From )
Where lev_= 1
Order by DESC
Select *
From (select row_number () over
In pl SQL, collection is an object composed of a group of ordered elements. The types of these elements must be consistent.
Pl SQL divides collection into three types: associative arrays (also called index-by tables), nested tables, and
The storage hierarchy in Oracle is as follows:
(1) A database consists of one or more tablespaces.
(2) A tablespace consists of one or more data files. These files can be cooked files in the file system, original partitions, database files managed
Summary of rownum usage in Oracle!For the rownum problem in Oracle, many documents do not support>, >=, =, between... and. The preceding symbols can only be used (,> =, =, .. and will prompt SQL syntax errors, but often cannot find a record, and it
**
We recommend that you use DBMS_Scheduler (note)
/* Query: Select job, broken, what, interval, T. * From user_jobs t; the unique identifier of the job, whether the automatically generated broken is running, N; run; Y: stop what is the name of the
In Oracle, an application of row and column Conversion
The table structure is omitted. The SQL statement is as follows:
select z.* from (select row_number() over(order by bs_cnt desc) rn, inn2.* from (select distinct sum(bv_sum) over(partition by
First_value and last_value: return the first and last values of the specified column.
Syntactically, there are differences between 9i and 10g:
9i:
FIRST_VALUE ( expr ) OVER ( analytic_clause )
10g:
FIRST_VALUE (expr [ IGNORE NULLS ]) OVER
The lag and lead analysis functions can retrieve the data of the first n rows of the same field (Lag) and the data of the last n rows (LEAD) as independent columns in the same query.
This operation can replace table self-join, and lag and lead have
Get table:Select table_name from user_tables; // The table of the current userSelect table_name from all_tables; // tables of all usersSelect table_name from dba_tables; // includes the system tableSelect table_name from dba_tables where owner =
1./* + all_rows */It indicates that the overhead-based optimization method is selected for the statement block, and the optimal throughput is obtained to minimize the resource consumption.For example:Select/* + all + _ rows */emp_no, emp_nam, dat_in
--------------------------------------------- Export file for user boss1214 ---- Created by user on, 9:34:30 ---------------------------------------------
Spool str_sum_ SQL .log
PromptPrompt creating type str_sum_objPrompt =PromptCreate or replace
Sometimes the database can be connected, and sometimes the database cannot be connected.
It may be that the current number of connections in the database has exceeded the maximum number it can process.
Code highlighting produced by Actipro
Concept of a game subject:A cursor is a memory Workspace of SQL, which is defined by the system or user as a variable. The cursor is used to temporarily store data blocks extracted from the database. In some cases, you need to transfer the data from
1. Create a sequence
Run the following command to create a sequence ):
CreateSequence test_sequenceIncrementBy 1 --Data added each timeStartWith 1 --Count from 1Nomaxvalue --Do not set the maximum valueNocycle --Always accumulate, not loopCache10;[
String functions:
Single-record functions in SQL1. ASCIIReturns the decimal number corresponding to the specified character;SQL> select ASCII ('A') A, ASCII ('A') A, ASCII ('0') zero, ASCII ('') space from dual;A A zero space-------------------------
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