I have following db sequence Java However with Hibernate I am getting following error which says hibernate is expecting increment by 50. Why is so? Edit1 Added java code. Answer The error message is quite clear. You have enabled (or not disabled) schema validation, so when the application starts Hibernate is …
Use of right in standard SQL in BigQuery
While running the following code in standard SQL in BigQuery, I’m getting an error stating Answer You can use substr() instead :
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,…
How to retrieve a column in SQL that cannot be GROUPED BY
SQLFIDDLE: sqlfiddle.com/#!9/a83823/4 I want to retrieve the first book released by each author in the table. I want to run a query that displays the author’s name, the title of the earliest book and …
Where clause on count column
I have two tables pdc and class select roll_no as roll,sum(pdc.amount) as amount,count(amount) as given, stu_profile.name,f_name,scholarship,class_id,batch_id,statuss from stu_profile left …
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…
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 usin…
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