Nth(n,split()) in bigquery -


i running following query , keep getting error message:

select nth(2,split(web_address_,'.')) +'.'+nth(3,split(web_address_,'.')) d , web_address_ [domains.domain  limit 10 

error message:
error: (l1:110): (l1:119): select clause has mix of aggregations 'd' ,
fields 'web_address_' without group clause
job id: symmetric-aura-572:job_axsxeyfypxbe2gpmlyzh6bkgdti

i tried use group clause on field d and/or web_address_, still getting errors group by.

does know why case? have had success similar query before.

you want use within record aggregation here, not group by

    select concat(p1, '.', p2), web_address_  (select    nth(2,split(web_ad`enter code here`dress_,'.')) within record p1,   nth(3,split(web_address_,'.')) within record p2, web_address_  (select 'a.b.c' web_address_)) 

p.s. if trying cut off first part of web address, easier right , instr functions.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -