External Article

Solving Complex T-SQL Problems, Step-By-Step

What should you do if your first, most intuitive solution to a problem ends up scanning the data more than is necessary, resulting in poor performance? Have you missed a new SQL Server feature that can remove inefficiency from your technique? Alternatively, do you need a little help, and some lateral thinking, to open the path to a different approach? Sometimes, the answer is "both".

SQLServerCentral Editorial

Natural Data

Can you own data itself or patent it? There's a Supreme Court case dealing with this right now. Steve Jones notes that the outcome could affect our jobs as we deal with more and more data and laws to control data are enacted.

Technical Article

SQL Server Central Webinar Series #23: Safeguard your data offsite with SQL Backup Pro

You may already have a great backup and recovery plan. However, if something were to happen to your databases and you needed to restore from your backups, you’d want to be in control, with the ability to access a copy of those backups quickly, restoring them with minimal downtime and minimal fuss.

In this session Grant Fritchey, SQL Server MVP, will discuss the key reasons why you need to have offsite backups, and the advantages of hosted storage. He’ll address some of the fears surrounding cloud backups, and show how offsite backup is made quick and easy with the new ‘backup to hosted storage’ features in SQL Backup Pro 7.3.

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