title: BigQuery | How to select * from previously defined CTE in the same query?
body: <p>I have the below SQL query which I want to run on BigQuery.
  I am constantly getting error : <strong>Unrecognized name: nojoin</strong> on the start of the select statement of CTE named <strong>onejoin</strong>.
  Please help. It works for uom_conversion.* in nojoin CTE but nojoin.* doesnt work in onejoin CTE.</p>
  <pre><code>WITH uom_conversion AS
  (
  select a.*,
  case when a.sales_unit in ('EA','ZIN') and b.unit = 'CSE' then ifnull(a.order_quan*b.bic_zconvfac,0.0) else a.order_quan end as cse_order_quan,
  from `dev-amea-analyt-datal-svc-db.dev_amea_h_sapbw_ptc_otc.v_sales_order_items_amea` as a
  left join `dev-amea-analyt-datal-svc-db.dev_amea_h_sapbw_mst.v_mat_unit_otc_amea` as b
  on a.material = b.material and a.sales_unit = b.bic_zaltunit
  ),
  nojoin AS
  (
  SELECT uom_conversion.*,
  case when unit_of_wt = 'KG' and doc_type = 'ZOR' then net_wgt_dl end as ship_ord_kg_mysg_osa
  from uom_conversion
  ),
  onejoin AS
  (
  SELECT nojoin.*,
  case when orders.doc_type = 'ZOR' and orders.reason_rej = '0' and delivs.biczdelv_itm = '0' and orders.unit_of_wt = 'KG' then orders.net_wgt_dl end as ship_ooqty_kg_mysg_osa
  from nojoin as orders
  left join `dev-amea-analyt-datal-svc-db.dev_amea_r_sapbw_ap_ptc_otc.v_sales_delivery_items_ap` delivs
  on orders.doc_number = delivs.doc_number
  ),
  twojoins AS
  (
  SELECT onejoin.*
  case when orders.doc_type = 'ZOR' and orders.reason_rej = '0' and delivs.biczdelv_itm != '0' and bills.bill_num = '' and orders.unit_of_wt = 'KG' then orders.net_wgt_dl end as ship_nsord_kg_mysg_osa,
  from onejoin as orders
  left join `dev-amea-analyt-datal-svc-db.dev_amea_r_sapbw_ap_ptc_otc.v_sales_delivery_items_ap` as delivs
  on orders.doc_number = delivs.doc_number
  left join `dev-amea-analyt-datal-svc-db.dev_amea_r_sapbw_ap_ptc_otc.v_sales_billing_items_ap` as bills
  on orders.doc_number = bills.doc_number
  )
  SELECT *
  from twojoins
  </code></pre>