Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 months ago. Improve this question I have a table like below. Table A The goal is to find consecutive rows which are <= 60 …
Tag: sql
If BULK INSERT fails because file does not exist then BULK INSERT Next file
I’m having an issue with BULK INSERT , the situation is the following : I’ve a folder path with probably 200 files in it but I’ve a table with 400 filenames that I must review if they exist in the same folder path. I need the BULK INSERT to search for this 400 filenames and if It does not fi…
Trying to utilize a window function instead of this script
I’m trying to improve my query for this topic at hand. I’m trying to find the top 5 and bottom 5 growth rates per state from 2020 to 2021 in my org. The table has the columns as specified: orderid, orderdate, totaldue, state, etc. (these are probably the most important columns). This is the query …
How to consecutively count everything greater than or equal to itself in SQL?
Let’s say if I have a table that contains Equipment IDs of equipments for each Equipment Type and Equipment Age, how can I do a Count Distinct of Equipment IDs that have at least that Equipment Age. For example, let’s say this is all the data we have: equipment_type equipment_id equipment_age Scre…
Sequelize how to return result as a 2D array instead of array of objects?
I am using Sequelize query() method as follows: Because I am selecting two columns with identical names (colname), in the result, I am getting something like: [{ “colname”: “val1” }, { “colname”: “val2” }…], and this array contains values only from the col…
Concatenate the contents of two rows into one column (SQL DB2)
as it says in the title, I need to return two records but in the same column, for example (I clarify that the following code does not work, it is only to understand my case): When doing the query, it would have to return something like Johnny|Depp in the first column and 45 in the second Answer There are 2
PGSQL query to get all records of a column containing line breaks
What is the shortest Pgsql query to get all records that contain a line-break in a given column ? Answer You can try something like this
Full text search failure on PostgreSQL
I have a PostgreSQL used to index text content. The SearchVector column is created successfully using the following code The content looks like the following: But if I try to run a query to get plurals or singular of manual (in Italian: manuale is one, manuali are 2 or more) it fails: return nothing return no…
Missing dates for specific identifiers without adding extra dates when this identifier is no longer in the database SQL
To put the problem in words, I have a massive table which includes subscribers and data for every day. If the subscriber no longer exists, then they will have no more records i.e. SUB123 no longer exists from the 28/10/2021 then this subscriber will have records up every day until 27/10/2021. The problem at h…
Can anyone help me on how to fetch MySQL table/s data in JSON format by querying itself which is similar to MS SQL Server
Below is the existing T-SQL code which generates table data in JSON format just by using the keyword FOR JSON PATH, include_null_value. How to implement the same in MySQL query itself??? Need possible solutions. /** Sample Table data in MS SQL server ***/ /** Fetching table data in JSON format ***/ key value …