Aggregrating varchar columns
Concatenate columns grouping on Index column (approach for summing varchar columns by grouping on index)
2016-05-12 (first published: 2009-09-13)
1,563 reads
Concatenate columns grouping on Index column (approach for summing varchar columns by grouping on index)
2016-05-12 (first published: 2009-09-13)
1,563 reads
Query that simulates running sp_spaceused on every applicable object in a database and gathering it all into a single result set.
2016-05-10 (first published: 2013-06-03)
2,284 reads
Yet another schedule description query with added grammatical improvements.
2016-05-06 (first published: 2016-04-20)
866 reads
I was recently asked to monitor the Database size on the SQL server, and display the results in a report.
2016-05-05 (first published: 2016-04-16)
811 reads
An enhanced version of a script originally posted by Robert Pearl some time ago. It now takes into account changes in the tabelresults for CHECKDB in latter versions of SQL Server.
2016-05-04 (first published: 2016-04-20)
1,280 reads
searches entire db for a string, number, or date, returns list of results
2016-05-02 (first published: 2016-04-20)
1,260 reads
As part of the application to monitor SQL health I created.
The procedure returns status of the SQL server Agent
2016-04-29 (first published: 2016-04-16)
621 reads
2016-04-28 (first published: 2016-04-07)
506 reads
An inline table valued function (iTVF) that can be used to calculate age in years.
2016-04-27 (first published: 2016-04-06)
1,075 reads
Function do return common datatime formats of a date.
select dbo.[KDT_FN_FORMATDATETIME]('LASTDAY DDDD',getdate())
2016-04-26 (first published: 2016-03-29)
1,650 reads
By Steve Jones
Redgate is a for-profit company. We look to make money by building and selling...
If you've ever loaded a 2 GB CSV into pandas just to run a...
By James Serra
What problem is Fabric Ontology trying to solve? For years, most data conversations have...
Tlp/Wa_Cs:0817-866-887 Jl. Brigjen Sudiarto No.294, Palebon, Kec. Pedurungan, Kota Semarang, Jawa Tengah 50273
Tlp/Wa_Cs:0817-866-887 Jl. Majapahit No.112, Pandean Lamper, Kec. Gayamsari, Kota Semarang, Jawa Tengah 50161
Tlp/Wa_Cs:0817-866-887 Jl. Jenderal Ahmad Yani No.24-26, Panderejo, Kec. Banyuwangi, Kabupaten Banyuwangi, Jawa Timur 68416
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