Oracle Notes: Data Operations

Source: Internet
Author: User

Before performing data operations, you must first have several Complete tables. Create two tables, tableA and tableB

Create table tableA (id integer, name varchar (25), age number );
Insert into tableA values ('20170101', 'jack', '25 ');
Insert into tableA values ('20170101', 'Mike ', '22 ');
Insert into tableA values ('20170101', 'amy ', '23 ');

Create table tableB (id integer, class number, grade number );
Insert into tableB values ('20170101', '3', '1 ');
Insert into tableB values ('20170101', '4', '2 ');
Insert into tableB values ('20170101', '3', '2 ');

The result is as follows:
650) this. width = 650; "height = 281>
1. query empty fields

Add a record with an empty ID in tableA, as shown in
650) this. width = 650; "height = 248>
Query empty fields (null)
Select * from table name where field name is null;
Select * from tableA where id is null;
650) this. width = 650; "height = 118>

As shown in, the record with an empty ID is queried.

2. order by statement
The order by statement is used to sort the result set based on the specified column.
BY default, the order by statement sorts records in ascending ORDER.
If you want to sort records in descending order, you can use the DESC keyword.
If you want to sort records in ascending order, you can use the ASC keyword.
Select * from table name order by field name DESC/ASC;
Select * from tableA order by age desc;
Select * from tableA order by age asc;
650) this. width = 650; "height = 295>

  • 1
  • 2
  • 3
  • Next Page

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.