Section courante

A propos

Section administrative du site

SELECT

Sélectionne
Sybase

Syntaxe

SELECT [ ALL | DISTINCT ]
[TOP unsigned_integer]
[
INTO [ [ database.] owner.] table_name
[ { [ EXTERNAL TABLE AT ]
server_name.[database].[owner].object_name
| EXTERNAL DIRECTORY AT ‘pathname
| EXTERNAL FILE AT ‘pathname’ [COLUMN DELIMINTER ‘string’ ] } ]
[ ON segment_name ]
[
PARTITION BY RANGE ( column_name[, column_name ]...)
( [ partition_name ] values <= ( { constant | MAX }
[, { constant | MAX } ] ...) [ on segment_name ]
[, [ partition_name ] values <= ( { constant | MAX }
[, { constant | MAX } ] ...) [ on segment_name ] ]...)

| PARTITION BY HASH (column_name[, column_name ]...)
{ ( partition_name [ ON segment_name ]
[, partition_name [ on segment_name ] ]...)
| number_of_partitions
[ ON (segment_name[, segment_name ] ...) ] }

| PARTITION BY LIST (column_name)
( [ partition_name ] VALUES ( constant[, constant ] ...)
[ ON segment_name ]
[, [ partition_name ] VALUES ( constant[, constant ] ...)
[ ON segment_name ] ] ...)

| PARTITION BY ROUNDROBIN
{ ( partition_name [ ON segment_name ]
[, partition_name [ ON segment_name ] ]...)
| number_of_partitions
[ ON ( segment_name [, segment_name ]...) ] }
]
[ LOCK { datarows | datapages | allpages } ]
[ WITH [, | max_rows_per_page = num_rows
| exp_row_size = num_bytes
| reservepagegap = num_pages
| identity_gap = gap [, | max_rows_per_page = num_rows
| exp_row_size = num_bytes
| reservepagegap = num_pages
| identity_gap = gap ] ...] ] ]

| INTO EXISTING TABLE table_name
]
[FROM table_reference [,table_reference]... ]
[WHERE search_conditions ]
[ GROUP BY [ALL] aggregate_free_expression
[, aggregate_free_expression]...]
[HAVING search_conditions ]
[ ORDER BY { [[[database.]owner.]{table_name.|view_name.}]column_name
| select_list_number
| expression }
[ASC | DESC] [, { [[[database.]owner.]{table_name.|view_name.}]column_name
| select_list_number
| expression }
[ASC | DESC]]... ]
[COMPUTE row_aggregate(column_name)
[, row_aggregate(column_name)]...
[BY column_name [, column_name]...] ]
[FOR {READ ONLY | UPDATE [OF column_name_list]} ]
[ at isolation
{ read uncommitted | 0 }
| { read committed | 1 }
| { repeatable read | 2 }
| { serializable | 3 } ]
[FOR browse]
[PLAN "abstract plan" ]

table_reference ::=
([[database.]owner.] {{table_name | view_name}
[AS] [correlation_name]
[INDEX {index_name | table_name }]
[PARALLEL [degree_of_parallelism]]
[PREFETCH SIZE ][LRU | MRU]}
[HOLDLOCK | NOHOLDLOCK]
[READPAST]
[SHARED]) | (table_reference (INNER | LEFT [OUTER] | RIGHT [OUTER]) JOIN table_reference
ON search_conditions)

Description

Cette instruction permet de sortir une liste de données à partir d'une ou plusieurs tables.



Dernière mise à jour : Dimanche, le 31 mai 2015