Skip to content

MySql using interval with a list of dates

I’m willing to fetch all the dates that are listed in the list reducing 1 day I’m trying something like that: I wish to receive: ‘2022-03-21’, ‘2022-03-17’, ‘2022-03-10’ Answer It can be done with intervals. Here is a link to how it works : https://www.db-fiddle…

Find ID which doesn’t exist from another table

I am studying SQL and I am not sure which is the way to filtering data. For example, there I have two tables: Reference_OrderTable: OrderID Item Price OrderTable: OrderID Item Price Reference_Ordertable: this table has all the type of orders. OrderTable: this is the actual order table, we store by customer&#8…

How to rotate a two-column table?

This might be a novice question – I’m still learning. I’m on PostgreSQL 9.6 with the following query: My query returns the following dynamic rows: locales count en 10 fr 7 de 3 n additional locales (~300)… n-count I’m trying to rotate it so that locale values end up as columns with a s…

BCP queryout hangs with READ COMMITTED transaction isolation

Using SQL Server 2016 and bcp version 14 My query returns about 16k rows and runs quickly to completion in SSMS with the default (READ COMMITTED) isolation level however if I try to save the output of the same query using BCP the tool hangs. If I set isolation level to READ UNCOMMITTED in the BCP query then i…

How to use group by with case statement [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 8 months ago. Improve this question I ha…

sql query that depends on each value of other table

I’m not used to query sentences and this one is a bit tricky, I don’t know even if it is possible (at least with just a single sql query) or if I should change the question name to something more accurated, if so let me know. I have two tables, I will make them simple. The first one that is