1. Write the program to list the required columns than direct write select * More intuitive. In this way, the performance of row data retrieval is the same, and the performance of column data retrieval is improved; When you select the required columns, you reduce IO and network transfer time to improve performance.
The 2.WHERE clause filters records with predicates such as =,<,>,<=,>=,!, <> and And,or.
The 3.NULL value is judged by IS null and is not NULL.
4. A column alias is especially important in a subquery.
5. Use | | To stitch the values of the columns.
6. Use the case when end clause to implement IF-ELSE judgment.
7. When top n is taken, it is important to note that rownum can fetch only the first n rows, not the nth row, and the nth row using Row_number ().
8. Random data collection (useful when making data):
SELECT * from ( SELECT ename, Job from emp ORDERby Dbms_random.value ()) WHERE<=5
9. Use the NVL or coalesce or case when end clauses to handle null values, as shown in the following example:
SELECT empno, ename, job, Comm Comm_raw, coalesce(comm,0-- or NVL (comm,0) Commfrom emp;
10. Use a like fuzzy match:% pass with _ placeholder.
Oracle Development <<sql Cookbook>> Learning Notes Collation: First chapter Search Records