Bert Wagner

Blog Post

Multiple Identity Inserts

Watch this week’s video on YouTube. This week I want to share something that surprised me about using SQL Server’s SET IDENTITY_INSERT statement. I started with two tables with...

2019-07-10 (first published: )

481 reads

Blog Post

Multiple Identity Inserts

Watch this week's video on YouTube
This week I want to share something that surprised me about using SQL Server's SET IDENTITY_INSERT statement.
I started with two tables with identity columns...

2019-06-25

9 reads

Blog Post

Multiple Identity Inserts

Watch this week's video on YouTube
This week I want to share something that surprised me about using SQL Server's SET IDENTITY_INSERT statement.
I started with two tables with identity columns...

2019-06-25

16 reads

Blog Post

Trailing Spaces in SQL Server

Watch this week’s episode on YouTube. A long time ago I built an application that captured user input. One feature of the application was to compare the user’s input...

2019-07-03 (first published: )

1,043 reads

Blog Post

Joker’s Wild

This past weekend I had a blast presenting Joker’s Wild with Erin Stellato (blog|twitter), Andy Mallon (blog|twitter), and Drew Furgiuele (blog|twitter). Watch it here! Table of contents: What is...

2019-06-25 (first published: )

452 reads

Blog Post

Joker's Wild

This past weekend I had a blast presenting Joker's Wild with Erin Stellato (blog|twitter), Andy Mallon (blog|twitter), and Drew Furgiuele (blog|twitter).

Watch this week's video on YouTube
Table of contents:

What is...

2019-06-11

9 reads

Blog Post

Joker's Wild

This past weekend I had a blast presenting Joker's Wild with Erin Stellato (blog|twitter), Andy Mallon (blog|twitter), and Drew Furgiuele (blog|twitter).

Watch this week's video on YouTube
Table of contents:

What is...

2019-06-11

2 reads

Blog Post

CHOOSE() in SQL Server

Watch this week’s episode on YouTube. While I know I don’t utilize most of the features available in SQL Server, I like to think I’m at least aware that those features...

2019-06-04

304 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

The New Software Team

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The New Software Team

Database Mail in SQL Server 2022

By Abdellateef Ibrahim

Comments posted to this topic are about the item Database Mail in SQL Server...

The string_agg function

By Alessandro Mortola

Comments posted to this topic are about the item The string_agg function

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