View previous topic :: View next topic
|
Author |
Message |
balu_ver2k5
New User
Joined: 17 Oct 2005 Posts: 2
|
|
|
|
Hi
Input
FIN__NUM MACH_MODEL MACH__NUM
2 6C1 3C24A
1 6C1 3C24A
1 6C1 3C26A
2 6C1 3C27A
oUPUT SHOULD CONTAINS
FIN__NUM MACH_MODEL MACH__NUM
2 6C1 3C24A
2 6C1 3C27A
PLEASE suggest a query for the above . it is not mandatory that fin_num should be always 2 . the query should extract max of fin_num |
|
Back to top |
|
|
aklima
New User
Joined: 25 Nov 2005 Posts: 18 Location: uae
|
|
|
|
well i think u want the whole record with fin_num to be max
then u can give subquery and i think the 3 are columns then this may be the answer
select FIN__NUM,MACH_MODEL ,MACH__NUM from input where fin_num=
(select max(fin_num) from input)
hope this will be the rgt query |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
As per ur req. the solution given by aklima is right. plz add this also to get in sorted order.
Code: |
select FIN__NUM,MACH_MODEL ,MACH__NUM from input where fin_num=
(select max(fin_num) from input) order by MACH_NUM; |
let me know if any other. |
|
Back to top |
|
|
Suryanarayana.tadala
New User
Joined: 03 Nov 2005 Posts: 43 Location: St.Louis
|
|
|
|
Hey Frnd's i think it that query should work.
select FIN__NUM,MACH_MODEL ,MACH__NUM from input where fin_num=
(select max(fin_num) from input) order by MACH_NUM; |
|
Back to top |
|
|
|