Situation: I am using wordpress and I have 60000 old posts. Now I have to update each posts with some new information. For some reason, I have to compare the custom fields in SQL and find the same …
Postgres join and count multiple relational tables
I want to join the 2 tables to the first table and group by a vendor name. I have three tables listed below. Vendors Table VendorOrders Table OrdersIssues Table The expected output is to count how many orders belong to a vendor and how many issues belongs to a vendor order. I have the below code but it’…
Generating counts of open tickets over time, given opened and closed dates
I have a set of data for some tickets, with datetime of when they were opened and closed (or NULL if they are still open). We would like to generate a table of data showing the total count of tickets that were open through time, grouped by date. Something like the following: Note that I am not sure about how
Postgresql work with null rows after joins
For example, we have next query: select A.id, A.field > (case when A.cond1 then (case when B.field is null then 0 else B.field end) else (case when C.field is null then 0 else C.field end) end) …
ClickHouse: How to store JSON data the right way?
I’m going to migrate data from PostgreSQL database to Yandex’s ClickHouse. One of the fields in a source table is of type JSON – called additional_data. So, PostgreSQL allows me to access json attributes during e.g. SELECT … queries with ->> and -> and so on. I need the same b…
how parallel fetch data from MySQL with Sequel Pro in R
I want to fetch data from mysql with seqlpro in R but when I run the query it takes ages. here is my code : old_value
postgres array of increments/decrements
I have a table like: +——+——+——-+ | Name | Date | Price | +——+——+——-+ | A | d1 | 5 | | A | d2 | 5.5 | | A | d3 | 5.75 | | A | d4 | 5.65 | | A | d5….
Insert .csv file to SQL Server using OpenRowSet
I have a .csv file, called File1 that I would like insert into my already existing table, called Table1 within SQL Server. The .csv file has the following structure and values: ID Location …
SQL select unique name based on max index
I have the following table -| id | name | index | number| answered| time | -|——-|————-|——–|——-|———|——————-| -| 043b | callline2 | 1 …
Overwriting nulls with parent data in a hierarchical query
I have a table with the following format: pk fk parent ===== ====== ======== 001 23 000 002 null 001 003 46 001 004 12 000 005 null 004 006 null 005 ===============…