Skip to content
Advertisement

Tag: sql

BigQuery Temp Table Column has no Name

I’m trying to create a temp table in BigQuery, something like: This results in error “CREATE TABLE columns must be named, but column 2 has no name”. I understand that it can’t extract a column name from MAX(t.event_date). Is there a way I can specify a column name? Answer Is there a way I can specify a column name? Use

SQL – split numeric into 2 columns?

I am trying to split some numeric keys in my table into separate columns (to help save space in SSAS, lower cardinality) My data looks like the below.. I want to split these into 2 columns… with 4 digits in each column. (where applicable, as anything 1>9999 won’t have anything populated in the 2nd column) So an example output of

Get first row that is null in Oracle DB table

I have the following table rownum ID date owner 1 1 09/01/2022 null 2 1 09/02/2022 null 3 1 09/03/2022 Joe 4 1 09/04/2022 null 5 1 09/05/2022 Jack 6 2 09/01/2022 null 7 2 09/02/2022 John 8 2 09/02/2022 John 9 2 09/02/2022 John For every ID, I want to select the first occurrence of null that eventually results

Laravel 9 – implode() and whereIn

Hello i’m using query builder in my laravel app. I’m trying to use the implode() method from query builder. So for example i expect a string composed from : ‘ 2,3,4… ‘ I have to use this string in next query where i use the raw query IN (‘value’, ‘value’) I’m trying to wrap those IDs in to single quotes

Advertisement