I have one bigquery table with 30 columns:
strcol,strcol1,strcol2,.. startstr, startstr1, startstr2,.. endstr, endstr1, endstr2,..
1111, 2343, 1012...... "car", "boat", "scooter"..... "plane", "bike", "boat"
9999, 1012, 3333...... "scooter", "boat", "scooter"..... "boat", "bike", "boat"
I need to scan all columns "strcol" to find a number. If I find the number I need to use the correspondent "startstr" and "endstr".
Example: Number 1012 is present in column "strcol2" then I need to use "startstr2" and "endstr2". My select statement only needs two columns. Result would be something like:
start, end
scooter, boat
boat, bike
I was thinking of creating an array of strcol...strcol9 and try to find the number and return the index, then use this index to find the correct startstr and endstr. But I don't know how to do this. Maybe there are much better alternatives? Any ideas?
The number 1012 will always be fixed and will never change.
Cheers, Cris

