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>