Useful T-SQL queries and scripts to work in SQL Server
This post is about some queries and scripts that I use in my daily work on SQL Server. Some of...
2018-12-26 (first published: 2018-12-05)
7,195 reads
This post is about some queries and scripts that I use in my daily work on SQL Server. Some of...
2018-12-26 (first published: 2018-12-05)
7,195 reads
This post is about some queries and scripts that I use in my daily work on SQL Server. Some of them are self-explanatory, i.e. the name of the query/script...
2018-12-05
406 reads
This post is about some queries and scripts that I use in my daily work on SQL Server. Some of them are self-explanatory, i.e. the name of the query/script...
2018-12-05
23 reads
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are...
2018-11-28 (first published: 2018-11-16)
4,462 reads
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are aimed for the beginner-level T-SQL developers. Always Use a...
2018-11-17
7 reads
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are aimed for the beginner-level T-SQL developers. Always Use a...
2018-11-17
15 reads
SSMS new versions come up with some cool features. The new features provide support for the SQL Server 2008 databases...
2017-12-28
889 reads
SSMS new versions come up with some cool features. The new features provide support for the SQL Server 2008 databases and onward. Vulnerability Assessment (active from SSMS 17.4) Right...
2017-12-28
3 reads
SSMS new versions come up with some cool features. The new features provide support for the SQL Server 2008 databases and onward. Vulnerability Assessment (active from SSMS 17.4) Right...
2017-12-28
3 reads
The usage of time zones in applications becomes inevitable, especially with the globalization of the applications. Reports need to be...
2017-08-31 (first published: 2017-08-18)
3,655 reads
By Steve Jones
I had mentioned some new T-SQL functions for SQL Server 2022 and a commenter...
This post comes off the back of my last, where I looked at issues...
By Vinay Thakur
As this is an Artificial Intelligence (AI) World, things are changing. We can see that...
Still trying to figure out options for automating the export the result of a...
A while into install I get a Microsoft OLE DB Driver for SQL Server....
Comments posted to this topic are about the item More Funny SELECTs
What does this code return?
SELECT ( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder FROM Sales.SalesOrderHeader AS soh WHERE soh.OrderDate > '01/01/2011' AND soh.OrderDate < '01/01/2012') AS OrdersIn2000 , ( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder FROM Sales.SalesOrderHeader AS soh WHERE soh.OrderDate > '01/01/2012' AND soh.OrderDate < '01/01/2013') AS OrdersIn2001 , ( SELECT COUNT (*), MAX(soh.OrderDate) AS latestorder FROM Sales.SalesOrderHeader AS soh WHERE soh.OrderDate > '01/01/2013' AND soh.OrderDate < '01/01/2014') AS OrdersIn2002; GOSee possible answers