Totals up to a specific date

  • Luis Cazares - Monday, February 25, 2019 2:48 PM

    patrickmcginnis59 10839 - Monday, February 25, 2019 2:33 PM

    Here's another example with two different styles that produce equivalent parsed trees:

    SELECT COLUMN1 FROM TABLE1;


    SELECT
        COLUMN1
    FROM
        TABLE1
    ;

    I have no argument with formatting styles, but lets call this what it is, a particular formatting style that you don't use or like, but to imply it informs of the OP's knowledge well lets just say I disagree.


    Those are formatting styles. Both use the semicolon to define the end of the SELECT statement.
    .If you believe that writing like this is ridiculous .Then maybe you can see my point .You don't start sentences with a period .You end them with one

    Actually there are specific rules for periods in written prose, in fact, there are rules for whitespace that precedes the period (ie., if the period ends a sentence, you don't want an intervening space). Write a letter in any grammar checking word processor if you don't believe thats a formalized rule for writing. This means that its a RULE OF THE LANGUAGE. We get away with sloppy writing because written language for us humanfolk gets interpreted using context, and we fill in the blanks.  Whitespace does matter with formal rules for writing, and especially periods, but more importantly, written prose is not a formalized context free grammar and that's a crucial differentiator. You cannot reliably and unambiguously parse written English without rules specifying limited subsets of the language. Yes, you can make stabs at it, but additional steps must resolve ambiguities. Heck, neural networks would be more appropriate for natural language given the progress that's been made. Think of it, we don't have statement SEPARATORS in English. We do not have operator precedence, scope of symbols, etc, but we as readers fill these things in if possible. Computer languages are just different. The language definitions have to be unambiguous. For the most part they are context free grammars. Your "period rule" just does not follow, THERE IS NO RULE THAT YOU CAN QUOTE. If it were Python it would be a completely different matter, carriage returns and whitespace are formalized tokens instead of token separators. Whitespace actually specifies "nesting" and such in Python.

    Additionally you are neglecting the actual reason we see this CTE with leading semicolon thing, its because Microsoft has consistently FAILED to produce tooling to migrate us to  semicolon use as many other programming languages standardize on, at least as how they would like us to do it. Heck when I code case statements in bash, I put my semicolons on their own line. I put my semicolons ON ITS OWN LINE because I LIKE IT THAT WAY (and of course because it needs two semicolons LOL). Why aren't you complaining about Microsoft then, instead of SLANDERING random posters here on SSC regarding their understanding of the subject matter? The OP knows EXACTLY why the semicolon is required, because the computer flippin told him. What else does he need to know?

    I think that's one of my gripes with SQL Server people, they paint one query with the mouse and think that earns them a phd in CS LOLOL


Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply