Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Column Option

Description

You can specify options such as ASC or DESC after the column name when defining UNIQUE or INDEX for a specific column. This keyword is specified to save the index value in ascending or descending order.

Syntax

column_name [ASC|DESC]

Example

CREATE TABLE const_tbl(

id VARCHAR,

name VARCHAR,

CONSTRAINT UNIQUE INDEX(id DESC, name ASC)

);

 

INSERT INTO const_tbl VALUES('1000', 'john'), ('1000','johnny'), ('1000', 'jone');

INSERT INTO const_tbl VALUES('1001', 'johnny'), ('1001','john'), ('1001', 'jone');

 

SELECT * FROM const_tbl WHERE id > '100';

===================================================

          id    name    

          1001     john     

          1001     johnny     

          1001     jone     

          1000     john     

          1000     johnny     

          1000     jone