Re: interesting problem
From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 08/13/04
- Next message: Roji. P. Thomas: "Re: interesting problem"
- Previous message: David Portas: "Re: fetch performance"
- In reply to: Lisa Pearlson: "interesting problem"
- Next in thread: Lisa Pearlson: "Re: interesting problem"
- Reply: Lisa Pearlson: "Re: interesting problem"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 08:42:14 +0100
It's useful to keep a table of Numbers in your database to help with queries
like this:
http://www.bizdatasolutions.com/tsql/tblnumbers.asp
Now try:
SELECT number
FROM Numbers,
(SELECT MIN(n), MAX(n)
FROM YourTable) AS T(min_n, max_n)
WHERE number BETWEEN min_n AND max_n
-- David Portas SQL Server MVP --
- Next message: Roji. P. Thomas: "Re: interesting problem"
- Previous message: David Portas: "Re: fetch performance"
- In reply to: Lisa Pearlson: "interesting problem"
- Next in thread: Lisa Pearlson: "Re: interesting problem"
- Reply: Lisa Pearlson: "Re: interesting problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|