Oracle-some SQL statements required for report Creation
Oracle SQL for report
It was freezing, and I stayed at home and read "Mastering Oracle SQL" 2nd. I found that Oracle is still ver
Oracle index creation and SQL optimization tutorial, oraclesql
Oracle index creation and SQL optimization tutorial
Database index:
The index has a single column index.
Compound Index
If a field in a table has primary key constraints and uniqueness constraints, Oracle automa
1. The downloaded Oracle SQL Developer, rpm file,: http://www.oracle.com/technology/software/products/ SQL /index.html
2. Install sun's jdk1.6. If it is already installed, skip this step. (linux mint 12 is installed by default.) command:Sudo apt-get install sun-java6-jdk
3. l SQL Develoepr setting is an rpm package b
Differences between oracle and SQL (common functions) (3) ORACLE functions
BitsCN.com
Rn S: select patindex ('% d % q %', 'sdsfasdqe ') value O: oracle not found, however, instr can use the fourth parameter to control the number of occurrences. select INSTR ('sdsfasdqe ', 'SD', 1, 2) value from dual returns 6
24. subst
Comparison of common functions of SQL Server and Oracle, sqlserveroracle
--------- Mathematical functions1. Absolute ValueS: select abs (-1) valueO: select abs (-1) value from dual2. INTEGER (large)S: select ceiling (-1.001) valueO: select ceil (-1.001) value from dual3. Round (small)S: select floor (-1.001) valueO: select floor (-1.001) value from dual4. Round (truncation)S: select cast (-1.002 as int) val
(3,4) value 81O:select Power (3,4) value from dual 81
12. Take random numberS:select rand () valueO:select Sys.dbms_random.value (0,1) value from dual;
13. Take the symbolS:select sign ( -8) value-1O:select sign ( -8) value from Dual-1
14. PiS:select PI () value 3.1415926535897931O: I don't know.
15.sin,cos,tan parameters are in radiansFor example: Select Sin (PI ()/2) value gets 1 (SQL Server)
16.asin,acos,atan,atan2 return radians
17. Radian Angle
believe that the 99 SQL, Oracle Basic written test is just like playing (the most complete, the most classic entry-level Oracle query statement)1. Select * from EMP;2. Select Empno, ename, job from EMP;3. Select empno number, ename name, job work from EMP;4. Select Job from EMP;5. Select distinct job from EMP;6. Select distinct empno, job from EMP;Description: Be
OracleThe database must be started.Parameter file. This article summarizes the Oracle database startup parameter file and provides some SQL statements related to the startup parameter file. Let's take a look at this part.
Summary of parameter files:
1. Initial parameter file: pfile (initialization parameter file)
2. server parameter file: spfile (server-side parameter file)
1. pfile is a text file, and spfi
Label: Chartorowid (C1) "function" conversion varchar2 type is ROWID value "parameter" C1, string, string length 18, string must conform to ROWID format "return" rowID value "Example" SQL> SELECT Chartorowid ('aaaadeaabaaaazsaaa') from DUAL; Chartorowid ('AAAADEAABAAAAZSAA--------------------------------------------------------------------------------aaaadeaabaaaazsaaa "description" in Oracle, each record h
Tags: ar using strong SP data on Problem BS SQLOperator optimizationIn operatorThe advantages of SQL in write are easier to write and easy to understand, which is more suitable for modern software development style.But SQL performance with in is always lower, and the steps taken from Oracle to parse SQL with in is the
Oracle indexing and SQL optimizationDatabase index:Index has a single column indexThe saying of compound indexHow a field in a table has a PRIMARY KEY constraint and a uniqueness constraint, Oracle automatically suggests a unique index on the corresponding constraint column. Database indexes are primarily made to improve access speed.Construction principles:1, th
PL/SQL single-line functions and group functionsA function is a program that has 0 or more parameters and has a return value. Oracle has built a series of functions in SQL, which can be called SQL or PL/SQL statements, and functions are divided into two main categories:Singl
46.Connect multiple scans
If you compare a column with a limited set of values, the Optimizer may perform multiple scans and merge the results.
Example:
SELECT *
FROM LODGING
Where manager in ('bill Gates', 'Ken muller ');
The Optimizer may convert it to the following form:
SELECT *
FROM LODGING
Where manager = 'bill Gates'
Or manager = 'Ken muller ';
When selecting the execution path, the Optimizer may scan the index range on LODGING $ MANAGER for
Three database date conversions comparison:http://blog.csdn.net/zljjava/article/details/17552741SQL type conversion function: Cast (type1 as Type2)Date types in the database SQL SERVERDATE 1970-01-01DATETIME 1970-01-01 00:00:00OracleDATE 2015-08-07 17:34:37TIMESTAMP 1970-01-01 00:00:00.000000 is the extended type of date, with fractional secondsDate-to-string OracleTo_char (sysdate, ' yyyy-mm-dd ')Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') as
Ext.: http://chwshuang.iteye.com/blog/933926In development, it is often necessary to write a SQL statement to insert information into a table, insert the data if the field is a date type, you must convert the date type to a string literal in the SQL statement to insert the database. This is the only method of my field, if there is an expert please another enlight
This article will introduce some functions in Oracle that are similar to SQL Server ISNULL functions.
Due to project requirements, you need to convert SqlServer to Oracle. Some Views in SqlServer use the ISNULL function. After finding out, the following Oracle functions are
1. Invalid Number:
Itself is a string format and must be converted to a string format
2. A non-numeric charactor was found where a numeric was expected:
The date format is also converted to the date format.
3. Column ambiguously defind:
The field is ambiguous. In each of the tables, you must specify the table field.
4. character to numeric Conversion error
It is originally a three-digit number. To convert to_char (273.4, '99. 9'
Tags: c a data using the name classJust learned the basics of Oracle, so I want to find some SQL problems to practice practiced hand, so I chose this 50sql statement, because the found version is not Oracle, so try to use Oracle to achieve.This blog post is mainly to record the 50 questions in the understanding of the
, or 25thDatePart (' y ', ' 2005-7-25 22:56:32 ') returns a value of 206 that is the No. 206 Day of the YearDatePart (' yyyy ', ' 2005-7-25 22:56:32 ') returns a value of 2005 that is 2005The SQL Server DATEPART () function returns a portion of the SQL Server datetime field.The syntax for the SQL Server DATEPART () function is:DATEPART (Portion, datetime)where da
) ename
------------------ ------------------ ----------
AAAAFKAACAAAAEQAAA aaaafkaacaaaaeqaaa SMITH
Aaaafkaacaaaaeqaab Aaaafkaacaaaaeqaab ALLEN
AAAAFKAACAAAAEQAAC AAAAFKAACAAAAEQAAC WARD
Aaaafkaacaaaaeqaad Aaaafkaacaaaaeqaad JONES
43.CONVERT (C,dset,sset)
Converts the source string sset from one language character set to another dset character set
Sql> Select CON
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.