sql - How to add rows in BigQuery -
I have data in this large table
+ ------- + --------- + ------ + ------ + | Chrome | Start | Stop it. Opposition | + ------- + --------- + ------ + ------ + | Chr1 | 1 | 5 | 0.3 | | Chr1 | 5 | 7 | 0.7 | | Chr2 | 1 | 3 | 0.2 | + ------- + --------- + ------ + ------ +
Where "value in value" To stop from the beginning, it is true for each number (though the number in the block is excluded). Now I want to get data in a non-collected way, so the table will look like this
+ ------- + --------- + - ---- + ------ + | Chrome | Start | Stop it. Opposition | + ------- + --------- + ------ + ------ + | Chr1 | 1 | 2 | 0.3 | | Chr1 | 2 | 3 | 0.3 | | Chr1 | 3 | 4 | 0.3 | | Chr1 | 4 | 5 | 0.3 | | Chr1 | 5 | 6 | 0.7 | | Chr1 | 6 | 7 | 0.7 | | Chr2 | 1 | 2 | 0.2 | | Chr2 | 2 | 3 | 0.2 | + ------- + --------- + ------ + ------ +
INSERT
The command is not supported by BigQuery Any suggestions for an alternate solution?
- Create a help table called "number" and the integer numbers ranging from 0 to the greatest reasonable value < / Li>
- Join your table with a cross-number table
- Apply numbers where. Number> = start and number. Number
This should look like this:
Chrome, select numbers. Start as number, numbers As the number 1 stop, the opposition numbers associated with your outlet cross where the numbers are. Number & gt; = Start and number Save your results in a new table or override existing one. Hope it helps
Comments
Post a Comment