|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
oracle sql command
Hello,
I am having problems making the fallowing select: Imagine this table: Serial_num | Sequence | Status --------------------------------------- 223344 | 2 | 2 223344 | 3 | 2 223344 | 4 | 2 223344 | 5 | 2 --------------->want this line 123456 | 2 | 2 123456 | 3 | 2 123456 | 4 | 2 --------------->want this line 111111 | 2 | 2 111111 | 3 | 2 --------------->want this line What i want is: Serial_num | Sequence | Status --------------------------------------- 223344 | 5 | 2 123456 | 4 | 2 111111 | 3 | 2 I want all the results where my SEQUENCE IS MAX... How can a make i select to retrive this values? Best regards Miguel |
|
#2
|
|||
|
|||
|
Code:
select * from thisTable as t1 where Sequence = ( select max(t2.Sequence) from thisTable as t2 where t2.Serial_num = t1.Serial_num) |
|
#3
|
|||
|
|||
|
...
Thkz
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > oracle sql command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|