Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234

Create a Tally or Numbers Table Expand / Collapse
Author
Message
Posted Tuesday, July 14, 2009 5:09 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, July 21, 2015 7:57 PM
Points: 25, Visits: 69
I didn't think of them but now that you pointed them out, you are right on both observations.

1. A single table starting at zero and a pass-through view with a >0 critiera.
2. Number1 and Number0 would be easier for casual user.


>if the use of BETWEEN is a pain
I'm curious how you would use BETWEEN when you need a zero-based number table.
Post #753113
Posted Tuesday, July 14, 2009 7:08 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:08 AM
Points: 41,216, Visits: 38,520
What I meant by the BETWEEN was, if you have a zero-based table and need a unit-based solution, then the WHERE clause would need to include WHERE N BETWEEN 1 AND @DesiredInt. That would also allow you to use just a single table.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #753131
Posted Thursday, November 24, 2011 4:39 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, June 13, 2016 5:34 PM
Points: 81, Visits: 403
Jeez Jeff, I knew you'd been doing Tally tables for a long time, but you wrote the article THAT long ago ?
Talk about nativity ...
Post #1211764
Posted Thursday, November 24, 2011 5:09 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:08 AM
Points: 41,216, Visits: 38,520
ben.mcintyre (11/24/2011)
Jeez Jeff, I knew you'd been doing Tally tables for a long time, but you wrote the article THAT long ago ?
Talk about nativity ...




--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1211767
Posted Saturday, May 21, 2016 7:48 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:08 AM
Points: 41,216, Visits: 38,520
RBarryYoung (5/1/2008)
Just google "tally table". The procedural (manual) form is used by schools a lot.


After 6 years, it would appear that Google has finally caught up with what is meant by a "Tally Table". At least insofar as how we use it.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1788680
« Prev Topic | Next Topic »

Add to briefcase «««1234

Permissions Expand / Collapse