selecting a set for min value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tamashee@yahoo.com

    selecting a set for min value

    Hi,
    I have the following set and would like to select all rows that have
    min value of column 4 for a given column 1 and 2 group, irrespective of
    column 3, as below:

    C1 C2 C3 C4
    ---------------------
    A B x 5
    A B y 10
    A BB XX 55
    A BB YY 11
    AA CC z 1
    AA CC zz 11

    Need
    ---
    A B x 5
    A BB YY 11
    AA CC z 1

    using sql server 2000 (which does not provide rank or partition by)
    Thanks in advance,
    Tamas

  • Tom Moreau

    #2
    Re: selecting a set for min value

    Please don't multi-post. I have already answered this in the Microsoft
    newsgroups.

    --
    Tom

    ----------------------------------------------------
    Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
    SQL Server MVP
    Toronto, ON Canada
    ..
    <tamashee@yahoo .com> wrote in message
    news:1144974479 .938931.193480@ z34g2000cwc.goo glegroups.com.. .
    Hi,
    I have the following set and would like to select all rows that have
    min value of column 4 for a given column 1 and 2 group, irrespective of
    column 3, as below:

    C1 C2 C3 C4
    ---------------------
    A B x 5
    A B y 10
    A BB XX 55
    A BB YY 11
    AA CC z 1
    AA CC zz 11

    Need
    ---
    A B x 5
    A BB YY 11
    AA CC z 1

    using sql server 2000 (which does not provide rank or partition by)
    Thanks in advance,
    Tamas

    Comment

    • Madhivanan

      #3
      Re: selecting a set for min value

      Also learn SQL

      A system administrator is an IT specialist who configures and maintains the stability of corporate networks and devices.

      W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.



      Madhivanan

      Comment

      Working...