Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Database Theory > Re: Avoiding an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 2522 of 2659
Post > Topic >>

Re: Avoiding an inline view using DML only

by Carl Federl <cfederl@[EMAIL PROTECTED] > Apr 23, 2008 at 01:00 PM

This is a common problem and a common solution is to have a table with
integers from zero to some large number (32,767 is common) as
described at
http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-numbers-table.html
Although the SQL statements are specific to MS SQL Server, they can be
adapted to other RDBMS.

Here is part of the article:
Generating date ranges

When you need to generate a set of dates in a range, the typical
solution is to create a loop and iterate through the range, adding a
day each time. However, a numbers table can help us generate this
range as a set, instead of treating each date in the range
individually. This way, you can use the code directly in a subquery or
in a table-valued function, without having to worry about creating a
tem****ary table to hold the values while you iterate through the loop.
 




 4 Posts in Topic:
Avoiding an inline view using DML only
Morten <usenet@[EMAIL   2008-04-23 05:22:46 
Re: Avoiding an inline view using DML only
Carl Federl <cfederl@[  2008-04-23 13:00:19 
Re: Avoiding an inline view using DML only
"David Cressey"  2008-04-24 09:59:19 
Re: Avoiding an inline view using DML only
MoMorten <usenet@[EMAI  2008-04-24 06:01:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 6:37:01 CDT 2008.