Skip to content
Advertisement

Tag: sql

Bigquery: Select top 3 with Group By condition

I have a table like this I want to select the top 3 total by groups. How can i do it? Answer In most [big data] use cases using ROW_NUMBER() is not fine as it ends up with resource exceeded error. This is because it requires all point of same group be present in same/one node which in case of

Fetching Results after ibm_db.execute()

Take a look at the following code: import ibm_db #Authentication Details f=open(r”C:UsersXXXXXMy Code.rc”,”r”) lines=f.readlines() us=lines[0].rstrip() pd=lines[1] sql_file = “NNM_SQL.sql” f = …

Advertisement