英[s??lekt] 美[s??l?kt]

vt.Select; select; select

adj. Selected; selected; harshly selected; <口> like to pick three Picky, picky

Third person singular: selects Present participle: selecting Past tense: selected Past participle: selected

redis SELECT command syntax

Function:Switch to the specified database, the database index number index is specified with a numeric value, and 0 is used as the starting index value.

Syntax: SELECT index

Description: Use database number 0 by default.

Available versions: >= 1.0.0

Time complexity: O(1)

Return: OK

redis SELECT command example

redis> SET db_number 0         # 默認(rèn)使用 0 號(hào)數(shù)據(jù)庫(kù)
OK
redis> SELECT 1                # 使用 1 號(hào)數(shù)據(jù)庫(kù)
OK
redis[1]> GET db_number        # 已經(jīng)切換到 1 號(hào)數(shù)據(jù)庫(kù),注意 Redis 現(xiàn)在的命令提示符多了個(gè) [1]
(nil)
redis[1]> SET db_number 1
OK
redis[1]> GET db_number
"1"
redis[1]> SELECT 3             # 再切換到 3 號(hào)數(shù)據(jù)庫(kù)
OK
redis[3]>                      # 提示符從 [1] 改變成了 [3]