I am trying to merge 2 of my columns in my select statement on bigquery so that I have one column with key value pairs rather than having 2 columns (one with the key and one with the value). I have attempted to use array_agg() but whenever I do it causes an error in the first line of my statement saying: "An expression references column colName which is neither grouped nor aggregated"
Any suggestions as to how to do this or what may be causing my array_agg error would be greatly appreciated.

mark accepted answerby using the tick on the left of the posted answer, below the voting. See meta.stackexchange.com/questions/5234/… for why it is important! When you get enough reputation on SO - vote up answers that are helpful. There are more ... You can check about what to do when someone answers your question - stackoverflow.com/help/someone-answers. Following these simple rules you increase your own reputation score and at the same time you keep us motivated to answer your questions :o) please consider! - Mikhail Berlyant