CREATE TABLE T_hq_e(XINGM VARCHAR2 (10),CHENGJ number is not NULL,Jiatzz VARCHAR2 (15))Tablespace SYSTEMPctfree 10Pctused 40Initrans 1Maxtrans 255Storage(Initial 16KMinextents 1Maxextents Unlimited);--ADD comments to the columnsComment on column
Unlike SQL Server, where the number of Oracle is different, SQL Server can set a value of self-increment.Oracle needs to establish a sequence first and then use Nextval.For example, if you want to generate such a code, 0001,0002,0003 ...First, a 1-n
Do not say Dbfirst Fortunately, it and Modelfirst,codefirst are each have a good, because of already exist a large business library, use entityframework more inclined to Dbfirst, because many colleagues have been accustomed to directly modify the
ViewWhat is a view?A view is also known as a virtual table, which is a fictitious table, which is a logical representation of a set of data.The view corresponds to a SELECT statement, and the result set is given a name, which is the name of the view.
The 1.Oracle database is used to test three tables, EMP (Employee Information table), Dept (Departmental information table), Salgrade (Salary scale table), and their table structure is as follows:2. Calculate the annual salary (no bonus is
[Email protected]> CREATE TABLE emp_1 as SELECT * from EMP; --Schedule table created. [Email protected]> CREATE TABLE dept_1 as SELECT * from dept; --table created for main tables. [Email protected]> ALTER TABLE dept_1 add constraint pk_dept_1
SELECT * FROM (select A.id,a.oacode,a.custid,a.custname,a.xsz,a.salename,a.communicationtheme, A.communicationproperty,a.communicationtime,a.productmanager,a.creator,a.createdate from Technology_flow a where A.oastate= ' normal end ' union select
ORACLE Database Simple testOperating system: Windows 7–Oracle:oracle Database 10.2.0.4First, the purposeTest the startup listener, the database is not the same user, whether the user can log on to the databaseIi. Introduction of the
1. Modify the data in the table: UPDATE statement:Grammar:Updtae table_name SET = value1,... [WHERE conditions](2), unconditional update (without a Where condition update): sql> update userinfo set userpwd= " 111111 " ; 4 rows updated. SQL >
1. Add data to the table (Insert statement):Syntax to add:INSERT into table_name (column1,column2,column3,......) VALUES (Value1,value2,value3,...)The fields after table_name can be omitted, except that each field of values must match the
1. Deleting data: Delete statement:Grammar:DELETE from table_name;(1), unconditional deletion:SQL>createtable testdel 2as Select * from userinfo; The table was created. SQL> Delete from Testdel; 4 rows deleted. SQL>Select* from testdel; rows
//login Command sqlplus sys/oracle as sysdba; //sys/oracle for username/password//delete table space mofdrop tablespace mof including contents and datafiles cascade constraints; //Delete User yaojiandrop user yaojian cascade; //CREATE
----------------------------------------------------------------------User:Dba_users storing information for all users----------------------------------------------------------------------Table:Dba_tables store all tables for all usersUser_tables
Oracle trunc function processing date format, oracletrunc
Select to_char (sysdate, 'yyyy-mm-dd hh24: mi: ss') from dual; -- display the current time2011-12-29 16:24:34
Select trunc (sysdate, 'Year') from dual; -- truncated to the year (the first day
Sort by calculated column and calculate Column
If you want to sort the calculated columns, you can specify aliases for the calculated columns and then sort them by aliases.
Create a test table:
Create or replace view v ASSELECT 3 AS a, 4 AS B
Oracle optimization auxiliary SQL statements, oraclesql statements
-- Query the SQL statement being executedSelect osuser computer logon identity,The PROGRAM that initiates the request by PROGRAM,USERNAME: the USERNAME used to log on to the
Oracle ReportViewer and how to view Oracle ReportsOracle Report Viewer and how to view Oracle Reports today's leaders raised a question, how to view Oracle Report output, how to set the default viewing program as a browser when copying files? I did
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