Re: HELP! SQL Query Question
From: R-D-C (billg_at_microsoft.com)
Date: 10/13/04
- Next message: Vic P: "Optimization help"
- Previous message: Jeronimo Bertran: "Re: LEFT OUTER JOIN with latest linked record"
- In reply to: V)arshall: "Re: HELP! SQL Query Question"
- Next in thread: R-D-C: "Re: HELP! SQL Query Question"
- Messages sorted by: [ date ] [ thread ]
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!
>>
- Next message: Vic P: "Optimization help"
- Previous message: Jeronimo Bertran: "Re: LEFT OUTER JOIN with latest linked record"
- In reply to: V)arshall: "Re: HELP! SQL Query Question"
- Next in thread: R-D-C: "Re: HELP! SQL Query Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|