I have a BQ table that looks like this
| website |
| -------- |
| xyz.com |
| abc.xyz.com |
| 123.abc.xyz.com |
| 098.com |
I want to clean up this table so that I only get the domain. In my ideal world I want to execute the following steps.
- For each row - Count number of '.'
- If there are more than 1 '.', THEN extract everything to the right of the second '.' from the right. So 'abc.xyz.com' gets extracted as 'xyz.com'
- If there is just 1 '.', THEN do nothing and give me the input as output. So 'xyz.com' gets outputed as 'xyz.com'
