Order by a column keeping the families together

  • CELKO (9/6/2012)


    Why did you fail to follow minimal Netiquette if you know the basics?

    Does anyone else see the irony in this?

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • CELKO (9/6/2012)


    .. it doesn't mean that I don't know any basics of data modeling, RDBMS or Date fields [sic] in SQL. I believe this forum is not just for experts and it is designed to help all levels of people.

    Columns are not fields. Did you learn anything? Have you looked up ISO-11179 or read a book on basic data modeling yet? Why did you fail to follow minimal Netiquette if you know the basics?

    Microsoft use column and field interchangeably in SQL Server error messages:

    SELECT message_id, text

    FROM sys.messages

    WHERE message_id IN (4158,4406,4866,8618,14380)

    AND language_id = 1033

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • ChrisM@Work (9/7/2012)


    CELKO (9/6/2012)


    .. it doesn't mean that I don't know any basics of data modeling, RDBMS or Date fields [sic] in SQL. I believe this forum is not just for experts and it is designed to help all levels of people.

    Columns are not fields. Did you learn anything? Have you looked up ISO-11179 or read a book on basic data modeling yet? Why did you fail to follow minimal Netiquette if you know the basics?

    Microsoft use column and field interchangeably in SQL Server error messages:

    SELECT message_id, text

    FROM sys.messages

    WHERE message_id IN (4158,4406,4866,8618,14380)

    AND language_id = 1033

    I guess that in the ivory tower in which he lives with his pet mouse they are not interchangeable. Each as a specific meaning and they are not the same.

  • 1. Columns are fields!

    Technically they are not.

    But in practice, many people refer to SQL columns as "fields", so you just have to accept that and move on.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • ScottPletcher (9/7/2012)


    1. Columns are fields!

    Technically they are not.

    But in practice, many people refer to SQL columns as "fields", so you just have to accept that and move on.

    What do you mean by "technically"? Technically, all things in a computer are just electricity impulses (charge or no-charge - 1's and 0's).

    As mentioned in above posts, even Microsoft sometimes uses both words for the same thing.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • @mickyT - your code works great. Thanks a lot.

  • @sergiy - Your code is good as long as the dates of the parents are different. If the dates of parents are same, the code is failing in keeping the families together. MickyT's code handles the case when the dates are same. Thanks anyways.

Viewing 7 posts - 16 through 21 (of 21 total)

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