SQL and Bible Studies:- Books in each Genre

Background The Bible is a collection of books. One can categorize the books in so many different ways. In this post, we will use someone else work. He has categorized bible books into genres.   SQL The work avails a couple of database platforms. In this post, we will provide working samples for Transact SQL … Continue reading SQL and Bible Studies:- Books in each Genre

Transact SQL – STRING_AGG – Error – “Multiple ordered aggregate functions in the same scope have mutually incompatible orderings.”

Background Working on some Transact SQL code yesterday. Ran into an error that was new to me. Error Error - Image Error - Text Sample Code The original code is a bit complex and sharing it will distract from this post's point. So here we go with sample code:-   Outline Original The original code … Continue reading Transact SQL – STRING_AGG – Error – “Multiple ordered aggregate functions in the same scope have mutually incompatible orderings.”

Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”

Background Working on a script, but noticed an error when I tried to sort the data using the String_Agg within group clause. Code Let us reproduce using a sample data set. SQL Sample -01 SQL Output Sample -02 Outline If one reviews our output, one will notice that the cities are listed based on the … Continue reading Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”