Study notes of SQL Programming DB2

Source: Internet
Author: User
Tags db2

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp

If you intend to update a column or delete a row, you cannot include a GROUP by or have clause in the SELECT statement W Ithin a DECLARE CURSOR statement. These clauses make it a read-only cursor.

Null values are ordered as the highest value.

A null value is not the same as zero or all blanks. A null value means unknown. Null values can is used as a condition in the WHERE and have clauses.

Comparing columns using a normal equal comparison (COL1 = COL2) would be true if both columns contain an equal non-null Value. If Both columns is null, the result would be false since null was never equal to any other value, not even another null Val Ue. Using the DISTINCT predicate, null values is considered equal. So (COL1 isn't DISTINCT from COL2) would be true if both columns contain a equal Non-null value and also when both column S is the null value.

Null values is treated as duplicate rows for DISTINCT.

Online Analytical Processing (OLAP) specifications is used to return ranking numbers and row numbers for the result rows of a query. You can specify RANK, Dense_rank, and Row_number.

The USING clause is equivalent to a joins condition where each column from the left table is compared to a column with the Same name in the right table.

? The use of recursive common table expressions and recursive views.

If you want to keep duplicates in the result of a Union, specify union all instead of just union.

Data Retrieval Errors/sqlcode

can use a select-statement within an INSERT statement to insert Zero, one, or more rows into a table from the result t Able of the select-statement.

Study notes of SQL Programming DB2

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.