3 SQL式
SQL式のタイプの構文
式は、1つ以上の値、演算子、およびある値に評価されるSQLファンクションの組合せです。一般に、式のデータ型は、そのコンポーネントのデータ型になります。
式にはいくつかの書式があります。この項では、各書式の式に対する構文を示します。副次句の構文については、「副次句」を参照してください。
関連項目:
SQL式の詳細は、『Oracle Database SQL言語リファレンス』を参照してください。
{ av_meas_expression | av_simple_expression | single_row_function_expression | case_expression | compound_expression | datetime_expression | interval_expression }
CASE { simple_case_expression | searched_case_expression } [ else_clause ] END
列の式は、単純式、複合式またはファンクション式であったり、あるいは対象となる表の列、制約および決定的ファンクションのみを含む式のリストの場合もあります。
{ (expr) | { + | - | PRIOR } expr | expr { * | / | + | - | || } expr | expr COLLATE collation_name } Note: The double vertical bars are part of the syntax (indicating concatenation) rather than BNF notation.
CURSOR (subquery)
expr AT { LOCAL | TIME ZONE { ' [ + | - ] hh:mi' | DBTIMEZONE | 'time_zone_name' | expr } }
組込みSQLファンクションまたはユーザー定義ファンクションを式として使用できます。
( expr1 - expr2 ) { DAY [ (leading_field_precision) ] TO SECOND [ (fractional_second_precision) ] | YEAR [ (leading_field_precision) ] TO MONTH }
table_alias.JSON_column [.JSON_object_key [ array_step ]... ]...
{ measure_column [ { condition | expr } [, { condition | expr } ]... ] | aggregate_function { [ { condition | expr } [, { condition | expr } ]... ] | [ single_column_for_loop [, single_column_for_loop ]... ] | [ multi_column_for_loop ] } | analytic_function } Note: The outside square brackets shown in boldface type are part of the syntax. In this case, they do not represent optionality.
{ table_alias.column. | object_table_alias. | (expr). } { attribute [.attribute ]... [.method ([ argument [, argument ]... ]) ] | method ([ argument [, argument ]... ]) }
:host_variable [ [ INDICATOR ] :indicator_variable ]
スカラー副問合せ式は、1つの行から1つの列値のみを戻す副問合せです。
{ [ query_name. | [schema.] { table. | view. | materialized view. } | t_alias. ] { column | ROWID } | ROWNUM | string | number | sequence. { CURRVAL | NEXTVAL } | NULL }
[ NEW ] [ schema. ]type_name ([ expr [, expr ]... ])