Technical Article

Finding the Nth Maximal Value

This procedure gets a tablename, column and an integer number N as parameters and finds the Nth maximum value of the column's value in a table for example :  running it with 'products', 'UnitPrice' , 13 ,  @reswill get the 13TH largest value of unitprice from products is no such N exist an error message […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2002-07-10

282 reads

Blogs

How I Built RAG for My Accounting App on Bedrock and pgvector

By

The first version of my accounting assistant could not find a single purchase of...

Why AI isn’t paying off yet, and what to invest in first

By

Why isn’t AI paying off yet? Drawing on lessons from digital transformation, Joyful Craftsmen...

Flyway Tips: Analytics Platforms (Snowflake and Databricks)

By

I’m really excited about some growth in Flyway support. I’ve been asking about this...

Read the latest Blogs

Forums

Pay for Performance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Pay for Performance, which is...

Slow - Linked server query

By krypto69

Hi I have this slow query that is pulling data from a linked server....

Too Many Choices

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Too Many Choices

Visit the forum

Question of the Day

Too Many Choices

I have a table, dbo.MasterBrands, with this data:

BrandID OfficialName
1       Samsung
2       Apple
3       Microsoft
4       Adidas
5       Coca-Cola
I run this query. What is returned for Coca-Cola?
SELECT CHOOSE(BrandID, 'Conglomerate', 'Tech and Design', 'Desktop', 'Apparel')
FROM dbo.MasterBrands;

See possible answers