Re: HELP! SQL Query Question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: R-D-C (billg_at_microsoft.com)
Date: 10/13/04


Date: Wed, 13 Oct 2004 22:23:40 +0100

Hehehe

I like reading these - Celko's greatest hits we call 'em. Always important
to make sure that your terminology is right ;-)

:-D

"(V)arshall" <Varshall@discussions.microsoft.com> wrote in message
news:E7A8C5EF-48DD-4F14-B659-6E545AE14422@microsoft.com...
> First of all, let me say a big Thank you to all those who have HELPED me
> thus
> far and to those who are still HELPING me.
>
> To Joe - You, sir, are an ass. You are right..I know enough to get me
> around
> in SQL, but I am by no means an expert. I really and truly am a C++
> developer. I just had a question that I thought could best be answered by
> the
> people who know SQL Server best. I got some great answers. And if you
> notice
> everyone else was more than happy to answer me without giving little
> smart-ass remarks. My question may have seemed stupid to them as well or
> worded strangely, but they still took time to HELP me.
>
> Newsgroups are here to help people(clueless or not) like me. Until you
> get
> over yourself, do the world a favor and stay off the newsgroups. ..
>
> "Joe Celko" wrote:
>
>> Please post DDL, so that people do not have to guess what the keys,
>> constraints, Declarative Referential Integrity, datatypes, etc. in your
>> schema are.
>>
>> >> In other words, I want to know how to add a counter to the results of
>> a query. <<
>>
>> Line numbers are done in the front end of a tiered architecture, not in
>> the database. And from the names you used in your narrative
>> description, you don't seem to know that a field is not anything like a
>> column. You still think a table is like a sequential file.
>>
>> Here is a quick kludge that will run like glue as the table gets larger.
>> But kludges are like that.
>>
>> SELECT F1.field1, F1.field2
>> (SELECT COUNT(F2.field1)
>> FROM Foobar AS F2
>> WHERE F2.field1 <= F1.field1) AS counter
>> FROM Foobar AS F1;
>>
>>
>> --CELKO--
>>
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>> Don't just participate in USENET...get rewarded for it!
>>



Relevant Pages

  • Re: Google
    ... [How to sort google newsgroups search result by 'earliest first'] ... > It helps some to increase the number of hits displayed per page, ... to get to the part of the German Job Centre web page that asked the ... groups that were who knows what, but definitely not newsgroups. ...
    (rec.arts.sf.fandom)
  • Re: Getting list of recently added IDENTITY items
    ... When the kludge is not a metric. ... two hits from the same IP address in the same ms is a little ... Key values must be discrete. ... State what version of SQL Server you are using and specify the content ...
    (comp.databases.ms-sqlserver)
  • Re: HELP! SQL Query Question
    ... people who know SQL Server best. ... Newsgroups are here to help peoplelike me. ... "Joe Celko" wrote: ... > Here is a quick kludge that will run like glue as the table gets larger. ...
    (microsoft.public.sqlserver.programming)
  • Re: Turn off searching ZIP files?
    ... as for your suggestion that there were lots of good hits from the ... Windows XP Search menu? ... Shenan Stanley wrote ... newsgroups tend to be a bit more focussed. ...
    (microsoft.public.windowsxp.customize)
  • Re: Getting list of recently added IDENTITY items
    ... When the kludge is not a metric. ... two hits from the same IP address in the same ms is a little ... Key values must be discrete. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)