Postgresql – How to show comma separated numbers in Postgres
I have a table like this: | size | |---------------| | 2880129015916 | | 2560 | | 0 | | 91570752 | | 8192 | | 21037156 | and I want to display the values as comma separated, for example,…
I have a table like this: | size | |---------------| | 2880129015916 | | 2560 | | 0 | | 91570752 | | 8192 | | 21037156 | and I want to display the values as comma separated, for example,…
how i will put null values in place of dataset containing zeroes in place of missing values. can you help me with the solutuion? in the new dataset the missing values were replaced by zeroes instead of null values. what…
I'm using a postgresql (15.5) database with the following logic: We have "meters" who measure electrical consumption. We have "computer meters" who are calculation of the measurements of different meters. For exemple "computedMeterA" = "meterA" + "meterB" I have classical…
I have table 'MyTable' containing the column 'observations' of type jsonb. The Json structure is as following: { ... obsList: [ { species: 'Goldfinch', number: 2 }, { species: 'House sparrow', number: 4 }, ... ] } If I want…
I'm trying to write a batch file to run on Task Scheduler on Windows server to delete some PostgreSQL archived files. Thought I use FORFILES and the following will list all the .backup files in the archived folders. SET "log=%USERPROFILE%tempdelete.log"…
Let's assume there is a following table: CREATE TABLE time_interval ( id SERIAL PRIMARY KEY, start_time TIMESTAMP NOT NULL, end_time TIMESTAMP ); Sample data: INSERT INTO time_interval (start_time, end_time) VALUES ('2024-02-10 01:30:00', null), -- pending ('2024-02-10 03:00:00', null), -- pending…
I want to add this query to a column in my table.I am using pgadmin select customer_id, count(*) from summary group by customer_id order by customer_id asc I got as far as ALTER TABLE summary add sum_of_rentals INT UPDATE SUMMARY…
I have a Spring Boot application that relies on 2 data sources: an third-party HTTP API and a PostgresSQL db. The database is queried using Spring Data JPA, I have set up all the classes for the entities and corresponding…
I am trying to write a stored procedure to get an employee by input ID. In SQL Server, it looks like this: CREATE PROCEDURE [dbo].[GetbyID] (@ID NVARCHAR(50)) AS BEGIN SELECT * FROM dbo.Employee AS M LEFT OUTER JOIN dbo.Position AS…
I just want to thank anyone that would like to spent some of his time to address my question. I just want to mention that I am not so good at SQL. Description of the problem. I have Orders table…