cockroachdb / cockroachdb/cockroach

Why does this query not work?

Open
#121,529 3 comments 0 reactions 0 assignees View on GitHub
C-bug O-community
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**
I used below query but does not work
```sql
SELECT t.table_name AS NAME,
(SELECT ( Sum(range_size_mb) * 1024 ) AS table_size
FROM [show ranges from table '"'||t.table_schema||'"."'||t.table_name||'"' with details]) AS table_size
FROM information_schema.tables t;
```

**To Reproduce**

1. Set up CockroachDB cluster ...
-> It is demo cockroach db which runs by ```cockroach demo```

**Expected behavior**
- Get table_name, table_size tables as result.
- substitute t.table_schema and t.table_name to t's table_schema and table_name

**Environment:**
- CockroachDB version: CockroachDB CCL v23.2.3
- Server OS: Ubuntu
- Client app: cockroach demo

Jira issue: CRDB-37308

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.