Creative Ways to Use the TOP Clause
Gregory Larsen discusses how to use the TOP clause to help solve requests where you want to restrict the number of records returned based on a record count.
Gregory Larsen discusses how to use the TOP clause to help solve requests where you want to restrict the number of records returned based on a record count.
Some new interresting points about trees and CTE in SQL Server : transforming a tree from auto reference to interval model (nested sets), calculating levels in interval model, creating a view of auto ref from an interval model, hierarchical numbering of items, and more. This article includes more examples based on his previous work.
How many DBAs need a solution to track those changes made for multiple systems? Auditing is becoming more and more prevalent in all systems and having a good solution can really make your DBA job interesting. New author Keren Ramot brings us his technique that works indepedent of the database structure.
Steve Jones takes a look at what's happening in the world of alternative energy, including cleaner nuclear power and energy from motion.
How do you cope with an executive's request to "bring back a time series of activity for all subscribers who were in platinum status as of X date," or "show me a time series of orders by sales region according to the sales organization as of Y"? Here's how data warehouse pros can cope with the common requirement to look back in time.
To optimize Transact SQL (T-SQL) data types in SQL Server, learn how each type affects performance -- I/O, RAM and CPU in SQL Server.
Keeping track of the amount of space in a database is something every DBA needs to do or face the dreaded "out of space" errors appearing on every client's desktop. SQL Server guru David Poole brings us an automated way of doing just that.
It's time for T-SQL Tuesday #198! This month's topic is change detection. The post T-SQL...
By James Serra
Model Context Protocol, or MCP, is one of those technical ideas that sounds more...
When starting with AWS RDS Aurora for managing relational databases in the cloud, many...
Jl. DR. Abdul Rivai No.11, Pasir Kaliki, Kec. Cicendo, Kota Bandung, Jawa Barat 40131
We suffered a SPAM attack from May 1-6, which unfortunately corresponded with time off...
Jl. Raden Saleh No. 13, 15, 17A, Daerah Khusus Ibukota Jakarta 10430
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