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

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

Format timestamp from mysql
When I tried this:
Code: date("m/d/Y H:i A", $row['timestamp'])
I got 12/31/1969 18:

array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h

SHOW TABLES Help
Hi all

I have the following

Code: [Select]<?php
$sql = "SHOW TABLES&quo

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

Anti Spam Code Problems
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

An odd assignment statement. Can someone explain this assignment to me?
What purpose is served by the bit of code between the two equal signs in the $installurl set? Is th

Adding Different Numbers From MySQL
Basically I have a mysql database with a couple prices as the following:

9.99
9.99
9.99

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

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