|
Posted by Colleen on 10/06/07 18:16
Hello!
I've only been dabbling in PHP and MySQL for a few months.
I'm trying to find out if there's a query/function similar to the RANK
function in Excel.
What I want to be able to do is take a list of dates from a particular
table field, and be able to rank each record in the order within which
in falls in those range of dates, because records are not always
entered in chronological order.
Here's a partial sampling of my table, showing the relevant fields for
this query.
casualtyID deathdate
1 2003-12-01
2 2007-06-20
3 2002-08-30
4 2007-01-01
5 2005-04-11
So, from this "ranking" query (that would generate the result $rank),
I want to be able to say:
echo "$casualtyID is the number $rank casualty to die in the current
wars in Iraq and Afghanistan\n";
Thank you!
Colleen Robledo
http://www.colleenrobledo.info
Navigation:
[Reply to this message]
|