Some special symbols in ORACLE

(198 messages) Some special symbols in ORACLE_Usage of special characters in Oracle_xuansiyu's Blog-CSDN Blog

oracle wildcards, the use of operators

  and matching test: like, not like   Null test: is null, is not null   Boolean link: and, or, not   Wildcards:   In the where clause, wildcards can be used with the like condition. In Oracle:   % (percent sign): Used to represent any number of characters, or possibly no characters at all.   _ (underscore): Indicates the exact unknown character.   ? (question mark): used to represent the exact unknown character.   # (#): used to represent the exact Arabic numerals, 0 to 9.   [ad] (square brackets): used to indicate the range of characters, here from a to d.   Single quotation marks ('): In Oracle, only single quotation marks should be used to enclose text, characters and dates, and quotation marks (including single and double quotation marks) should not be used to enclose numbers.   Double quotes ("): In Oracle, single and double quotes have different meanings. Double quotes are used to enclose column aliases that contain specific characters or spaces. Double quotes are also used to put text into a date format. Apostrophe (   ' ): In Oracle, apostrophes can also be written as two single quotes adjacent to each other. To find all supplier names with apostrophes in the middle of the supplier name, you can write the code like this: select * from l_suppliers where supplier_name like '   % ''%'

















  & symbol: In Oracle, the & symbol is often used to indicate a variable. For example, &fox is a variable that is a slightly different type of &&fox. You are asked to provide a value for &fox whenever it appears in an Oracle script. Whereas with &&fox, you only need to give &&fox the variable value the first time it occurs. If you want to use the & symbol as a normal symbol, you should turn off this feature. To turn off this feature, you can run the following command: set define off , this is a SQLplus command, not a SQL command. SQLplus sets up the environment where SQL runs in Oracle.


  Double vertical bars (||): Oracle uses double vertical bars to represent string concatenation functions.


  Asterisk (*): select * means to select all columns, count (*) means to count all rows, and when it represents a wildcard, it means 0 or any number of characters.
  Forward slash (/): In Oracle, used to terminate the SQL statement. More precisely, it means "run the SQL code that is currently in the buffer". Forward slashes are also used to separate items.
  Multi-line comments: /*...*/.
  Not equal to: There are various expressions: !=, ^=, <>, not xxx=yyy, not(xxx=yyy)

Guess you like

Origin blog.csdn.net/zr_xs/article/details/131781487