content/shared/sql-reference/functions/cache.md
The {{< product-name >}} SQL implementation supports the following functions that return data from {{< product-name >}} caches.
Returns data from an {{< product-name >}} distinct value cache.
distinct_cache(table_name, cache_name)
{{< expand-wrapper >}}
{{% expand "View distinct_cache query example" %}}
SELECT * FROM distinct_cache('example_table', 'exampleCacheName')
{{% /expand %}} {{< /expand-wrapper >}}
Returns data from an {{< product-name >}} last value cache.
last_cache(table_name, cache_name)
{{< expand-wrapper >}}
{{% expand "View last_cache query example" %}}
SELECT * FROM last_cache('example_table', 'exampleCacheName')
{{% /expand %}} {{< /expand-wrapper >}}