title: Parametrized Table name and Column name in Standard SQl Bigquery
body: <p>I need to pass column name and table name as parameters to the query at run time.</p>
  <p>Example</p>
  <pre><code>#standardSQL
  SELECT '''
  SELECT AID, ''' || (
    SELECT STRING_AGG(DISTINCT &quot;MAX(IF(key = '&quot; || key || &quot;', value, NULL)) AS &quot; || key)
    FROM `project.dataset.table`
  ) || '''  
  FROM `project.dataset.table`
  GROUP BY 1
  ORDER BY 1
  '''
  </code></pre>
  <p>In the same query above would like to replace hardcoded AID, key  with parameterised value and the same for table name as well.</p>
  <pre><code>#standardSQL
  DECLARE 
  SELECT '''
  SELECT &lt;parameter col&gt;, ''' || (
    SELECT STRING_AGG(DISTINCT &quot;MAX(IF(&lt;parameter col&gt;= '&quot; || &lt;parameter col&gt;|| &quot;', value, NULL)) AS &quot; || &lt;parameter col&gt;)
    FROM `project.dataset.table`
  ) || '''  
  FROM `project.dataset.table`
  GROUP BY 1
  ORDER BY 1
  '''
  </code></pre>