By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

SQL Query

P: n/a
Hello
I would like to agregate several rows :
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18
and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13


for the result
In fact, I would like to obtain 1 single row for the same couple (C1,C2)

what should be the request ?
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Alain" <al****@hotmail.com> wrote in
news:bj**********@news-reader2.wanadoo.fr:
Hello
I would like to agregate several rows :
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18


and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13


for the result
In fact, I would like to obtain 1 single row for the same
couple (C1,C2)

what should be the request ?


You cannot do that.

You can get
C1 C2
---------- ----
VINET 5
TOMSP 5
TOMSP 6
TOMSP 7

By issuing the SQL statement
SELECT DISTINCT C.C1, C.C2 from C
given C as the name for your table, or

SELECT C.C1 from C will give you
C1
----------
VINET
TOMSP
Bob Q
Nov 12 '05 #2

P: n/a
"Alain" <al****@hotmail.com> wrote in message
news:bj**********@news-reader2.wanadoo.fr...
Hello
I would like to agregate several rows :
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18
and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13

select C1, min(C2) as C2_min, min(C3) as C3_min
from alain
group by C1

for the result
In fact, I would like to obtain 1 single row for the same couple (C1,C2)


select min(C2) as C2_min, min(C3) as C3_min
from alain

Nov 12 '05 #3

P: n/a
TC
DON'T POST THE SAME QUESTION UNDER DIFFERENT HEADINGS!

I just spent some time answering the other friggin' one.

This is not a good way to get further help :-(

TC
"Alain" <al****@hotmail.com> wrote in message
news:bj**********@news-reader2.wanadoo.fr...
Hello
I would like to agregate several rows :
I would like
C1 C2 C3
---------- ---- ----
VINET 5 10
VINET 5 11
VINET 5 12
TOMSP 5 13
TOMSP 5 13
TOMSP 6 18
TOMSP 7 19
TOMSP 6 19
TOMSP 7 18


and to obtain
C1 C2 C3
---------- ---- ----
VINET 5 10
TOMSP 5 13


for the result
In fact, I would like to obtain 1 single row for the same couple (C1,C2)

what should be the request ?

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.