Oracle GROUP_CONCAT() Equivalent

Some RDBMSs have a GROUP_CONCAT() function that allows you to return a query column as a delimited list (for example, a comma separated list). MySQL and MariaDB are two that have such a function.

PostgreSQL and SQL Server have similar functions called STRING_AGG().

Oracle, on the other hand, has the LISTAGG() function that does pretty much the same thing (and perhaps more).

So you could say that LISTAGG() is Oracle’s GROUP_CONCAT() equivalent.

Continue reading

SHOW DATABASES Equivalent in SQL Server – sp_databases

There are several ways to show a list of databases in SQL Server. Probably the easiest way is to use the sp_databases stored procedure.

The sp_databases stored procedure is a kind of SQL Server equivalent to the SHOW DATABASES command that can be used with DBMSs such as MySQL and MariaDB. OK, maybe they aren’t strictly equivalents, but based on their ease of use, they could be viewed as such from a user’s perspective.

Continue reading