SubQuery in the Select clause

Is it possible to do subquery like this in CRDB?

select ID, (Select Name from User where User.UID = G.UID) from T_Log_Msg G;

I’ve tried, but it seems I can’t reference the master table and it gave me this error

pq: source name "g" not found in FROM clause

It can be rewirte in join statement, but if this kind of query is support will be better in my case.

Thanks.

Hi,

This is a correlated subquery. CockroachDB doesn’t support correlated subqueries yet. Please follow https://github.com/cockroachdb/cockroach/issues/3288 for more details.

Thanks,
Jordan