content/commands/sdiffstore.md
{{< note >}} This command's behavior varies in clustered Redis environments. See the [multi-key operations]({{< relref "/develop/using-commands/multi-key-operations" >}}) page for more information. {{< /note >}}
This command is equal to [SDIFF]({{< relref "/commands/sdiff" >}}), but instead of returning the resulting set, it
is stored in destination.
If destination already exists, it is overwritten.
{{% redis-cli %}} SADD key1 "a" SADD key1 "b" SADD key1 "c" SADD key2 "c" SADD key2 "d" SADD key2 "e" SDIFFSTORE key key1 key2 SMEMBERS key {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="sdiffstore-return-info" tab1="RESP2" tab2="RESP3" >}}
Integer reply: the number of elements in the resulting set.
-tab-sep-
Integer reply: the number of elements in the resulting set.
{{< /multitabs >}}