I have query that results into one row table and I need to get this result in subsequent computation. Here is non working simplified example (just to depict what I'm trying to achieve):

```
SELECT amount / (SELECT SUM(amount) FROM [...]) FROM [...]

```

I tried some nested sub-selects and joins (cross join of the one row table with the other table) but didn't find any working solution. Is there a way to get this working in BigQuery?

Thanks, Radek

EDIT:

ok, I found solution:

```
select
  t1.x / t2.y as z
from
  (select 1 as k, amount as x from [...] limit 10) as t1
join
  (select 1 as k, sum(amount) as y from [...]) as t2
on
  t1.k = t2.k;

```

but not sure if this is the best how to do it...