Scripts

Technical Article

Data Sample Scripter

Generates code for INSERTs as well as generating data form tables for INSERT. Will also find and script all dependencies recursively, present all scripts in dependency order, and generate a reverse-dependency order set of conditional DELETE statements.

You rated this post out of 5. Change rating

2016-06-13 (first published: )

2,157 reads

Blogs

Stop Using Pandas for Aggregations — Try DuckDB Instead

By

If you've ever loaded a 2 GB CSV into pandas just to run a...

Understanding Fabric Ontology

By

What problem is Fabric Ontology trying to solve? For years, most data conversations have...

QUOTENAME Basics: #SQLNewBlogger

By

Recently I ran across some code that used a lot of QUOTENAME() calls. A...

Read the latest Blogs

Forums

Alamat kontak resmi BCA KCP Pedurungan | Tlp/Wa:0817866887

By Layanan_BCA

Tlp/Wa_Cs:0817-866-887  Jl. Brigjen Sudiarto No.294, Palebon, Kec. Pedurungan, Kota Semarang, Jawa Tengah 50273

Alamat kontak resmi BCA KCP Majapahit Telp:0817866887

By Layanan BCA_24jam

Tlp/Wa_Cs:0817-866-887  Jl. Majapahit No.112, Pandean Lamper, Kec. Gayamsari, Kota Semarang, Jawa Tengah 50161

Alamat kontak resmi BCA KCU BANYUWANGI Telp:0817866887

By Layanan BCA 24 JAM

Tlp/Wa_Cs:0817-866-887  Jl. Jenderal Ahmad Yani No.24-26, Panderejo, Kec. Banyuwangi, Kabupaten Banyuwangi, Jawa Timur 68416

Visit the forum

Question of the Day

The string_agg function

We create the following table and then insert some records in it:

create table t1 (
   id int primary key,
   category char(1) not null,
   product varchar(50)
);

insert into t1 values
(1, 'A', 'Product 1'),
(2, 'A', 'Product 2'),
(3, 'A', 'Product 3'),
(4, 'B', 'Product 4'),
(5, 'B', 'Product 5');
What happens if we execute the following query in both Sql Server and PostgreSQL?
select id, 
category, 
string_agg(product, ';')
                 over (partition by category order by id
                 rows between unbounded preceding and unbounded following) as stragg
from t1;

See possible answers