SQL statement Note 2

Source: Internet
Author: User
1. Bind and replace variables, and how to use them, that is, how to assign them to SQL statements in a way that is not manually input. General variables (global. Variable declaration in the sqlplus environment: Use ":" to change the Variable n to the bound variable: SQLexec: n: 7844; 2. There is a return, and this is the data type you want to display, you can

1. Bind and replace variables, and how to use them, that is, how to assign them to SQL statements in a way that is not manually input. General variables (global. Variable declaration in sqlplus environment: SQLvariable n number uses ":" to change the Variable n to the bound variable: SQLexec: n: = 7844; 2. A response is returned, and this is the data type you want to display, you can put

1. Bind and replace variables, and how to use them, that is, how to assign values in SQL statements is not manually input. General variables (global.

Variable declaration in sqlplus environment: SQL> variable n number

Use ":" To Change Variable n to the binding variable: SQL> exec: n: = 7844;

2. If there is a return value and the value is the data type you want to display, it can be placed in the select column. The column after select is equivalent to a variable.

3. the SQL statement where a <(select count (*) from t) does not cause an error because (select count (*) from t) the result is a table with a column and a row. It is equivalent to a variable returned.

4. during development, (two-dimensional) tables can be considered as the following situations:

A table row is a struct variable, a column is a member variable in the struct, and a table is an array composed of struct.

5. How can I view the number of rows of a block?

6,Group by must be placed before order by and limit. Otherwise, an error will be reported.. (Not verified)


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.