Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Response to query
Message
De
06/04/2007 01:17:28
 
 
À
05/04/2007 19:01:50
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01212334
Message ID:
01212875
Vues:
18
I'd like to throw my vote out there if you don't mind. I very much appreciate seeing these kind of examples.

Walter has been a contrian on almost every topic if an example is given that doesn't match the VFP way. And for those of us not married to VFP, your work and sharing is very much appreciated.

>There is a better solution ...
>
>
SELECT top 1 *
>	FROM Invoice A
>	WHERE debno = @nDebno AND
>		(SELECT SUM(amount) FROM Invoice B WHERE debno = @nDebno and B.inv_date <= A.Inv_date) > @nTreshhold
>ORDER BY inv_date
>
>First, this is much better than your first query - glad my blog post helped you to rethink your original one. <s>
>
>However, the query using a CTE only hits the invoice table once, whereas yours hits it twice. While there is no guarantee on execution plan, more developers are likely to opt for an approach that only hits the table once, if they are able to do so.
>
>The UDF approach certainly helps if you have multiple developers and this logic is needed elsewhere. Additionally, a table-valued UDF and APPLY operator will come in extra-handy if you want to start running this job for each customer.
>
>Second, say what you want about me...your motives are clear. JB wasn't the only one who observed that you had formed strong prejudices before I replied with something. I realize it's not very good etiquette to rattle off bullet points from a CV, but I've got an MS Gold Partner asking me to write SQL courseware, and SQL user groups asking me to come speak. So either (a) you're the enlightened one, I'm a fraud and they're all complete idiots....OR....(b)you're still a little hacked off that I and others have corrected you in the past about things you've said about .NET. For crying out loud, you're still stomping on JVP's name, and he hasn't been up here for roughly two and a half years!!!
>
>Third...your previous statement..."Solving problems that are hierarchical and nested in nature are best helped with a record oriented approach rather than a SET ORIENTED" is a segue to my last point. I've never challenged your knowledge on databases per se (and I don't know how you think you can challenge mine)....what I've been trying to say is that your posts indicate that you're not up to speed with some of the more recent enhancements in Microsoft products. A second example coming later tonight on your views on hierarchical data...
>
>Finally....Walter, I don't mind these challenges (so long as they are ones that don't take days to work on)...I take community contributions seriously. I'm not out to prove anything to you, as I seriously doubt that's posssible - I'm more interested in helping others. BUT...if you want to challenge me to do something.....DON'T follow up five minutes later with a 'let me help you' that's accompanied by a half-baked solution to "prove" your point, and then still expect me to respond.
>
>Kevin

(On an infant's shirt): Already smarter than Bush
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform