While running the following code in standard SQL in BigQuery, I’m getting an error stating Answer You can use substr() instead :
Tag: sql
Summing totals from nested and unnested data in a single query
I am working on nested Google Analytics data to build a query, I need to unnest 3 levels in order to get all the fields I need, but once I have unnested the SUM() of my .totals fields are far too high,…
Input of anonymous composite types is not implemented – Postgres
I have a table with an XML column. The XML can contain an optional link element. 1d177dee-1da4-4451-b175-396666afc370 I …
SQL: Running Total of Occurrences
I am using Metabase with a PostgreSQL implementation. I’d like to achieve the outcome in the photo. I wish to include a column that counts how many times a field has occurred above. It should include the current instance as well. Other examples I’ve seen have simply counted total occurrences. As I am ordering by date, I do not wish
Query HAVING MAX() doesn’t work as expected
I have four tables in a database. the tables are like the following: Cashier(cashier_id*, cashier_name) Category(category_id*, category_name) Product(product_id*, product_name, price, category_id**) …
How to call DBMS_CRYPTO.HASH when inserting a CLOB into Oracle with Python?
I’m storing CLOBs in Oracle. To speed up finding identical CLOBs, I’d like to introduce a hash value of the CLOBs. What I tried so far is INSERT the CLOB UPDATE the hash value based on the stored clob. How can this be done in one operation instead of two? This doesn’t work: (Oracle 12.2 using Python and cx_Oracle 6.3)
Dapper query with dynamic list of filters
I have a c# mvc app using Dapper. There is a list table page which has several optional filters (as well as paging). A user can select (or not) any of several (about 8 right now but could grow) filters, each with a drop down for a from value and to value. So, for example, a user could select category
Select everything except rows with maxvalue in certain column
I have a table with data and I’m trying to select some values with lower value than maximum. I am using IBExpert, I need to do this in SQL because I am working on a Firebird database. My table looks like this: What I want is to select only rows with GRUPA values lower than maximum, here max value is
Excel VBA – Stored Procedure (SQL Server)
I have a slight issue retrieving multiple recordsets (with column names) and pasting the data into an Excel sheet, like the image below The VBA code that I have just retrieves the first recordset but …
JDE how to convert F983051.VRPODATA (long / blob) to a string (varchar2)?
JDE how to convert F983051.VRPODATA (long / blob) to a string (varchar2)? I’m not sure if I can do something like: Where FUNCTION is something that converts the BLOB file into a varchar2. P.d. I cannot use any kind of DDL. Please advise, Answer I actually found what I wanted: DBMS_LOB.SUBSTR({BLOB field}). That field can help you for BLOB &