DELETE Subquery


Subquery로 키를 삭제

Subquery로 키를 삭제합니다.

테스트 데이터 입력

Example

명령>mset id_0001 myname1 id_0002 myname2 id_0003 myname3 id_0004 myname4 id_0005 myname5
결과>OK
명령>rpush id_list id_0001 id_0002 id_0003 id_0004 id_0005
결과>5
명령>sadd id_set id_0001 id_0002 id_0003 id_0004 id_0005
결과>5
명령>zadd id_zset 10 id_0001 20 id_0002 30 id_0003 40 id_0004 50 id_0005
결과>5
명령>hset myname1 f1 v1
명령>hset myname2 f1 v1
명령>hset myname3 f1 v1
명령>hset myname4 f1 v1
명령>hset myname5 f1 v1

DELETE FROM STRING.ID* WHERE IN (SELECT ...)

Main query String - Subquery List

Example

명령>delete from string.id* where key in (select value from list.id_list);   opcode
결과> 5 keys deleted

Main query String - Subquery Set

Example

명령>delete from string.id* where key in (select value from set.id_set);   opcode
결과> 5 keys deleted

Main query String - Subquery ZSet

Example

명령>delete from string.id* where key in (select value from zset.id_zset);   opcode
결과> 5 keys deleted

Main query String - Subquery Hash

Example

명령>delete from string.id* where value in (select key from hash.myname*);   opcode
결과> 5 keys deleted

OPCODE


delete from string.id* where key in (select value from list.id_list);

delete from string.id* where key in (select value from set.id_set);

delete from string.id* where key in (select value from zset.id_zset);

delete from string.id* where value in (select key from hash.myname*);


<< Delete Stream Delete Subquery

Email 답글이 올라오면 이메일로 알려드리겠습니다.