title: Bigquery- Struct format
body: <pre><code>WITH yourTable AS (
        SELECT 1 AS id, '2013,1625,1297,7634' AS string_col UNION ALL
        SELECT 2, '1,2,3,4,5'
      )
  
      SELECT id, 
        (SELECT ARRAY_AGG(CAST(num AS INT64)) 
          FROM UNNEST(SPLIT(string_col)) AS num
        ) AS num,
        ARRAY(SELECT CAST(num AS INT64) 
          FROM UNNEST(SPLIT(string_col)) AS num
        ) AS num_2
      FROM yourTable
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/y4Mq9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y4Mq9.jpg" alt="enter image description here"></a></p>
  
  <p>This is how exactly my actual table is designed and Now I would like to multiply num*num_2 and then later sum it up. Is there a way to get this into struct format like ID, nums.num,nums.num_2 so that I can simply multiply which gives me the necessary result.</p>
  
  <p>PS: I am looking for solution in the select statement above but not within "with" statement.</p>