First things first: I’m using PostgreSQL 11.6, compiled by Visual C++ build 1800, 64-bit. 🙂 Im trying to create a JSON object directly from the database. My desired result is { “1”: [], “…
Tag: group-by
Is there anybody who can help me with mysql query?
SELECT (SELECT SUM(kwh) FROM energy_logger WHERE TIME >= ’05:30:00′ AND TIME = ’18:30:00′ AND …
How to add a column of total number of rows in BigQuery
I have a table in BigQuery where I save a DATESTAMP and temperature sensor value. I usually filter the query by dates. My goal is to add a column in this query where it puts the total number of rows. For example, if I run this query I have this result: And when I run this query I have this
How to flatten Rows into Column (Field) Values
I have data that has Job_ids split across multiple rows (i’ve had to do this because previously i’ve had to split out team members from each job_id, then identify their teams The format my data is currently in is as follows, (not shown) but each job_id has an employee who has a team assigment, and therefore for each row there
How to divide with each other the two queries with different conditions?
There is a table in which the managers column and the status column. How to calculate the total status of Fully, the divided total of records with all statuses except N / A for each manager? I tried to portray in this way, but nothing came of it First Query Second Query Need to recieve two columns with name and
SQL order with equal group size
I have a table with columns month, name and transaction_id. I would like to count the number of transactions per month and name. However, for each month I want to have the top N names with the highest …
Group by using linked tables
I have linked tables. Calls and Call Lines, both tables have a seperate ‘Call Type’ field, I am trying to get the number of calls and the number of call lines which were added on a certain date and then see the split for the types. The below query returns the number for each Call Line which was added, but
MySQL query or procedure to return table from values computed over multiple rows
I have a network created MYSQL table with following fields: IP_SRC, IP_DST, BYTES_IN, BYTES_OUT, START_TIME, STOP_TIME 1.1.1.1 8.8.8.8 1080 540 1580684018 1580684100 8.8.4.4 1.1.1.1 2000 …
How do I sum up each Month of data for each product?
I have a set of data such as: Date Product Volume 01-01-2020 A 5 02-01-2020 A 25 03-01-2020 B 20 02-01-2020 B 10 04-01-2020 C 5 02-02-2020 …
Oracle GROUP BY clause is having issue
SQL Query in oracle database is: SELECT max(employee_id) from bank_data group by job_type having job in (‘Engineer’,’Artist’); My table data is: I get below error: ORA-00979: not a GROUP BY …