0
SELECT
  id,(select something
   from table2 
   where table2.id = table.id) AS "Description"
 FROM table

我收到此错误:

presto error: Scalar sub-query has returned multiple rows

如何在 presto 中编写子查询?

4

1 回答 1

1

Presto 确实支持嵌套查询。我认为问题在于您的语义。

您正在尝试从嵌套查询中投影某些内容,并且它需要一个标量值。

可能是这样的——

select
id, desc from 
(select table.id as id, something as desc
    from table2 
    where table2.id = table.id)
于 2020-06-02T16:33:42.133 回答