dbTalk Databases Forums  

selecting a set for min value

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss selecting a set for min value in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tamashee@yahoo.com
 
Posts: n/a

Default selecting a set for min value - 04-13-2006 , 07:27 PM






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


Reply With Quote
  #2  
Old   
Tom Moreau
 
Posts: n/a

Default Re: selecting a set for min value - 04-13-2006 , 07:42 PM






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 (AT) yahoo (DOT) com> wrote

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


Reply With Quote
  #3  
Old   
Madhivanan
 
Posts: n/a

Default Re: selecting a set for min value - 04-21-2006 , 06:02 AM



Also learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan


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.