Skip to content
Advertisement

Tag: google-bigquery

Filling a column with similar values in SQL

I’m beginner on StandardSQL My Table : I need your help to get the transactionId to be duplicated on each row instead of the Blank. My Query : Answer You already have transactionId on each row. Your query generates rows where each row has transactionId and some array. The BigQuery GUI just formats array elements to separate rows. You probably

Modify data in a specific format

I want to represent data in a specific format. Currently, the data looks like below- I want to represent it in the below format- Is is there a way to get the data in this format? Answer You want to unpivot and filter. Here is a BigQuery’ish way to do this:

SQL – get specific text from string

I have column with this strings: I need to get from the string ONLY the contact_type__* part (appears only once in each row) Any suggestions? Answer You could use regexp function regexp_extract(), like: This will match on string ‘contact_type__ followed by a sequence of letters, numbers, or underscore (which are commonly defined as word characters).

Advertisement