title: SQL SPLIT a string by means of delimiters but reporting NULL when there is missing values
body: <p>I am working with BigQuery and I want to split this following kind of string:
  ;%20kostenlos%20%20online%20%20game;b;g;177393617893;
  into 5 different values. The code I am using is this following:</p>
  
  <pre><code>   FROM (select *, FIRST(SPLIT(clicks_table.affiliate_sub5, ';')) part1,
     NTH(2, SPLIT(clicks_table.affiliate_sub5, ';')) part2,
     NTH(3, SPLIT(clicks_table.affiliate_sub5, ';')) part3,
     NTH(4, SPLIT(clicks_table.affiliate_sub5, ';')) part4,
     NTH(5, SPLIT(clicks_table.affiliate_sub5, ';')) part5
  </code></pre>
  
  <p>What I am getting stuck into is this: for some strings, some values are missing, and when it happens, that code is not reporting NULL for that piece, but the following piece of string. As instance:</p>
  
  <pre><code>;%20kostenlos%20%20online%20%20game;b;;177393617893;
  </code></pre>
  
  <p>then it will be splitted this way:</p>
  
  <pre><code>   part 1 = %20kostenlos%20%20online%20%20game
     part 2 = b
     part 3 = 177393617893 (instead of NULL)
     part 4 = blank (instead of 177393617893)
     part 5 = blank (and that's fine)
  </code></pre>
  
  <p>How to avoid that? </p>