SELECT 절

설명

SELECT 절은 지정된 테이블에서 원하는 컬럼을 조회한다.

구문

SELECT [ qualifier ] select_expression [ { TO | INTO }
variable [ {, variable } ] ]

qualifier :  
ALL
DISTINCT
UNIQUE

select_expression :
*
table_name. *
expression [ {, expression}...]

variable :
[:] identifier

예제

SELECT DISTINCT host_nation FROM olympic;

=== <Result of SELECT Command in Line 1> ===
  host_nation
======================
  'Australia'
  'Belgium'
  'Canada'
  'Finland'
  'France'
...
18 rows selected.

SELECT * FROM olympic;
 
=== <Result of SELECT Command in Line 1> ===
    host_year  host_nation           host_city             opening_date  closing_date  mascot                slogan                introduction
=======================================================================================================
         1988  'Korea'               'Seoul'               09/17/1988    10/02/1988    'HODORI'              'Harmony and progress'  'The 1988 Seoul Games we
re the first Olympics to allow professional athletes to compete in certain events…
         1992  'Spain'               'Barcelona '          07/25/1992    08/09/1992    'Cobi'                'Friends Forever '    'For the first time in decades, no nations boycotted the 1992 Barcelona Games…
         1996  'United States of America'  'Atlanta '            07/19/1996    08/09/1996    'Izzy'                'The Celebration of the Century '  'The 1996 Atlanta Games celebrated 100 years of the Modern Olympic Games.
...
25 rows selected.