I’m trying to make a bulk insert with a native query. I’ve added batch_size property to the application.properties file But in the logs, I see that every insert processed separately. Is it possible to apply batching to native query? Answer If the entities use GenerationType.IDENTITY identifier gen…
Use SSIS to split a single field value into multiple rows in a second table
So the situation is I am writing an SSIS package to migrate data from an old database to a new database. In the old database we have a Text column called comments that is filled with sometimes 30MB of …
How to exclude users with multiple options sql
Trying to retrieve just users that don’t have a disabled campaign, where disabled = 1. A user can have a disabled campaign and a non-disabled campaign, but if they have any disabled campaigns I want …
sum of amount earned medals for 1-day, 2-day and 3-day based on daily cohort users
I need some help with cohort analys. I have: users user_id installed_at 111 01.03.2020 112 01.03.2020 119 02.03.2020 120 02.03.2020 …
Oracle Analytical Function?
For the given table below, how can we find the customer whose name appears 3 times consecutively. Desired_Output Table Definition: Code Tried so far I believe we can do this by using lead/lag to get the previous and next row. Although my solution gives the desired output but i don’t think this is correc…
Something wrong with this SQL query?
Is there something wrong with this query? SELECT id, ( 6371 * acos(cos(radians(?1)) * cos(radians(latitud)) * cos(radians(longitud) – radians(?2)) + sin(radians(?1)) * sin(radians(latitud)))) …
Limiting SQL query to 10,000 results by where clause only, by string field
I have an interesting issue that I’m struggling to solve. I am retrieving data from a DB via a web API. I have direct DB access for testing, but my application will need to read the data via the API. In the API I can essentially provide the where clause for the SQL statement that retrieves my data from …
how to split one row of result in to two rows in impala
Below is the requirement and it needs to converted in SQL. I will receive only one record from source but I need to verify below condition and split it into two rows in impala. Expected values from …
Postgres query to filter by distinct column value AND further by distinct week
Ive got a query which will return me the count of distinct ‘artists’ on a playlist, but id like to further filter this by unique weeks using the created_at timestamp column my current query is: select …
Get subset of rows based on a list of primary keys in file
I have a large (1000s) list of IDs in a text file. I want to return the rows from my database that correspond to these IDs. How can I do this? My current method is to simply paste the whole list into …