Demystifying the use of CASE in an ORDER BY statement
Chuck Hoffman exposes the mysteries of getting CASE statements to work in dynamic ORDER BY statements.
2015-06-05 (first published: 2012-04-26)
26,651 reads
Chuck Hoffman exposes the mysteries of getting CASE statements to work in dynamic ORDER BY statements.
2015-06-05 (first published: 2012-04-26)
26,651 reads
Chuck Hoffman shows a technique using sets for selecting records from hierarchies such as Manager / Employee structures.
2012-05-03
9,740 reads
Are multiple binary switches becoming hard to manage? The TestBits function can help with that.
2012-04-09
4,227 reads
By Steve Jones
I went to sleep while reading a Kindle book on my phone. I know...
A conversation with Jan Laš, CIO at HOPI, about what deploying a data agent...
It's time for T-SQL Tuesday #198! This month's topic is change detection. The post T-SQL...
Telp/WA.0821°3111°179 Jl. Metro Pondok Indah No.60 & 61 UA, Pd. Pinang, Kec. Kebayoran Lama,...
Telp/WA.08213111179 Jl. Dewi Sartika No.189, RT.1/RW.5, Wil, Kec. Kramat jati, Kota Jakarta Timur, Daerah...
Telp/WA.0821°3111°179 Menara BCA, Grand Indonesia, Jl. M.H. Thamrin No.1, Menteng, Kec. Menteng, Kota Jakarta...
I have this data in a table called dbo.NFLTeams
TeamID TeamName City YearEstablished ------ -------- ---- --------------- 1 Cowboys Dallas 1960 2 Eagles Philadelphia 1933 3 Packers Green Bay 1919 4 Chiefs Kansas City 1960 5 49ers San Francisco 1946 6 Broncos Denver 1960 7 Seahawks Seattle 1976 8 Patriots New England 1960If I run this code, how many rows are returned?
SELECT TOP 2
json_objectagg('Team' : TeamName)
FROM dbo.NFLTeams;
See possible answers