![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi .. I am geeting myself into many knots around how to do thsi extraction. There is a table that contains the following: aID bID cID dID -------------------------- 6 9 28 1 6 2 28 2 6 11 28 3 6 1 27 5 6 9 27 5 6 11 27 5 I am trying to get a result of: aID bID cID dID -------------------------- 6 9 28 1 6 2 28 2 6 11 28 3 6 1 27 5 So, something like "the set off all values over bID which have the greatest cID". Any ideas? Many thanks, in advance, -- -mark. |
#3
| |||
| |||
|
|
There is a table that contains the following: aID bID cID dID -------------------------- 6 9 28 1 6 2 28 2 6 11 28 3 6 1 27 5 6 9 27 5 6 11 27 5 I am trying to get a result of: aID bID cID dID -------------------------- 6 9 28 1 6 2 28 2 6 11 28 3 6 1 27 5 So, something like "the set off all values over bID which have the greatest cID". Any ideas? |
#4
| |||
| |||
|
|
select t.aID, t.bID, t.cID, t.dID from the_table t join ( select bID, max(cID) max_cID from the_table group by bID ) s on t.bID = s.bID and t.cID = s.max_cID |
![]() |
| Thread Tools | |
| Display Modes | |
| |