Summary
Use the DELETE statement to delete data from the table.
Basic routines
DELETE [from] table
[WHERE condition];
Basic ApplicationUse the WHERE clause to specify the deleted record.
DELETE from Departments
WHERE department_name = '
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
My method source code:
public boolean addtickets (Ticketsvo vo) {Boolean flag = false;Date in the corresponding databaseTimestamp stamp = Dateconventer.strwithtimetotimestamp (Vo.getbegintime ());Object[] Paramvalues={vo.getticketname (),
There are many ways in which time can be stored in a database, but it is mainly date-oriented, with Oracle as an example
Typically write a time condition directly in a database statement for example: c_datetime
The more classic error is
Example Demo:
(1) Query the data in the users of the table.
Select U.id,u.realname,u.sex from Users u;
Query results are as follows
ID Realname SEX1 10082 Pine XX2 10084 Lin xx 13 10087 West XX4 10100 hu xx5 10102 Dragon xx 1......
(2) The "sex" in
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
Reader to like:
Developer: If you are doing database development, the content of this article is very suitable, because this article is from the programmer's point of view on database performance optimization.
Architect: If you are a database
1. Create user
Sql> Create user Jack identified by Jack;
2. Change Password
Sql> alter user Jack identified by Rose;
3. Authorized users
Sql> Grant Dba,resource,connect to Jack;
4. Permission to receive
Sql> revoke DBA from Jack;
5. Lock
In today's ATM, the data is processed using pure JDBC, and when it is discovered that the relationship between user and Card,log is used, the field in the card is associated with the ID in user, and the number of inserted and updated rows that are
Workaround:
1. View database lock, diagnose the source and type of lock :
Select Object_id,session_id,locked_mode from V$locked_object;
or use the following command:
Select B.owner,b.object_name,l.session_id,l.locked_mode
From V$locked_object
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
1, with the DBA role of the user login, to unlock, set the specific time format in order to view the specific time
Sql> alter session set nls_date_format= ' Yyyy-mm-dd hh24:mi:ss ';
Session altered.
2, to see the specific time locked
Sql> Select
rownum: According to the result set of SQL query to assign a logical number for each row, can change dynamically, according to the SQL of each query changes to renumber, each is starting from 1 automatic arranging;
Rowid: When the data is produced
Restore Segment Purpose:Transaction fallback--when a transaction modifies a row in a table, the old image of the modified column (the data to be restored) is stored in the restore segment. If the transaction is rolled back, the Oracle server
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->
Connect Resource Permission
Grant Connect,resource to user;
Permissions that the user includes after executing the above SQL statement:
Connect Role:--is the typical right to give end users, the most basic
Alter session--modifying sessions
Create
The original source of this article:
Http://blog.csdn.net/tianlesoftware/archive/2009/10/23/4717318.aspx
There are 4 ways to convert plain tables into partitioned tables :
1. Export/import method
2. Insert with a subquery method
3. Partition
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