Re: I need help with SELECT statement

From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 04/15/05

  • Next message: Sophie Guo [MSFT]: "Re: MS03-031 on WS03 SP1"
    Date: Thu, 14 Apr 2005 21:25:37 -0400
    
    

    Learn how not to multi-post to every single group and next time maybe you'll
    get some help.

    -- 
    Adam Machanic
    SQL Server MVP
    http://www.datamanipulation.net
    --
    "Vanessa Lee" <van77788@yahoo.com> wrote in message
    news:IJidnUG9p_Y9i8LfRVn-sQ@comcast.com...
    > Hi, Could you help me modify the SELECT statement below that would
    > accomplish my final goal.
    >
    > SELECT col1, col2 FROM table1 WHERE col3 < @V
    >
    > In col1 rows have many duplicates
    > col2 has unique values
    > col3 can have 5 possible values: 5, 10, 15, 20, 25
    > Variable @V can be equal to 5 or 10 or 15 or 20 or 25
    >
    > The goal is to:
    >
    > Return row values from col1 without duplicates, and return corresponding
    > values from col2 (both col1 and col2 in one row) "WHERE" col3 always has
    > maximum value from all possible values but is <= @V
    >
    > Thank you.
    > Vanessa
    >
    >
    

  • Next message: Sophie Guo [MSFT]: "Re: MS03-031 on WS03 SP1"

    Relevant Pages

    • Re: I need help with SELECT statement
      ... Learn how not to multi-post to every single group and next time maybe you'll ... SQL Server MVP ... > In col1 rows have many duplicates ... > Return row values from col1 without duplicates, ...
      (microsoft.public.sqlserver.datamining)
    • Re: I need help with SELECT statement
      ... Learn how not to multi-post to every single group and next time maybe you'll ... SQL Server MVP ... > In col1 rows have many duplicates ... > Return row values from col1 without duplicates, ...
      (microsoft.public.sqlserver.tools)
    • Re: I need help with SELECT statement
      ... Learn how not to multi-post to every single group and next time maybe you'll ... SQL Server MVP ... > In col1 rows have many duplicates ... > Return row values from col1 without duplicates, ...
      (microsoft.public.sqlserver.datawarehouse)
    • Re: I need help with SELECT statement
      ... Learn how not to multi-post to every single group and next time maybe you'll ... SQL Server MVP ... > In col1 rows have many duplicates ... > Return row values from col1 without duplicates, ...
      (microsoft.public.sqlserver.ce)
    • RE: I need help with SELECT statement
      ... "Vanessa Lee" wrote: ... > accomplish my final goal. ... > In col1 rows have many duplicates ... > Return row values from col1 without duplicates, ...
      (microsoft.public.sqlserver.olap)