max function question


Posted on 16th Feb 2014 07:03 pm by admin

Hi All
Ihave a table that holds shipment numbers and dates like this

select * from ship_tab;
ship_num date_ship
1 09-SEP-09
2 17-SEP-09
3 25-SEP-09

i want to fetch the highest ship_num and its date.
right now if i'm doing
select max(ship_num),date_ship from ship_tab
group by date_ship;
it give me :
ship_num date_ship
1 09-SEP-09
2 17-SEP-09
3 25-SEP-09
i want a query to give me
ship_num date_ship
3 25-SEP-09
without doing two fetches is it possible?
thanks

No comments posted yet

Your Answer:

Login to answer
140 Like 53 Dislike
Previous forums Next forums
Other forums

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

IDOC error
Hi, When i send IDOC from ECC system to MII there is no problem ECC side, i says message sent succe

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

restricting another login once you logout
Hello,

how can I restrict a page from login authenticating against info in a MySQL DB for a s

Inter Company -- Resources Related Billing (Services Industry)
Hello,

My company has a scenario where:
Company A bills Company C for INTER (cross

How to generate a random array of integers subject to a certain constraint
I am writing a program that asks the user to enter an integer N and then generates a random array of

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

SCRIPT ERROR
Here is the CONTACT FORM I made for our website:

<form id="form1" name="

Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:
"a.b.c.d.e.f&

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash