dbTalk Databases Forums  

I need help with SELECT statement

microsoft.public.sqlserver.clustering microsoft.public.sqlserver.clustering


Discuss I need help with SELECT statement in the microsoft.public.sqlserver.clustering forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vanessa Lee
 
Posts: n/a

Default I need help with SELECT statement - 04-14-2005 , 08:16 PM






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



Reply With Quote
  #2  
Old   
Kalen Delaney
 
Posts: n/a

Default Re: I need help with SELECT statement - 04-15-2005 , 10:43 AM






Vanessa

This question has nothing to do with clustering. It looks like you have
posted to every single SQL Server newsgroup, regardless of relevancy. Please
do not do this.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


"Vanessa Lee" <van77788 (AT) yahoo (DOT) com> wrote

Quote:
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





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.