ME is Maine
MA is Massachusettes
----- Original Message -----
From: "Peter Brawley" <peter.brawley@stripped>
To: "James Tu" <jtu@stripped>
Cc: "MySQL List" <mysql@stripped>
Sent: Thursday, March 22, 2007 12:32:41 PM (GMT-0500) Auto-Detected
Subject: Re: Finding a record in a result set
>I want to do a query of all employees from Maine, ordered by hiring date,
>and figure out where Joe falls in that list. (i.e. which record number
If 'Joe' is a unique name LOL...
SELECT 1 + COUNT(*)
WHERE name <> 'Joe' AND state = 'MA' AND hiredate < <datevalue>;
James Tu wrote:
> Is there some quick way to do the following in MySQL? (I know I can
> use PHP to search through the result set, but I wanted to see if
> there's a quick way using some sort of query)
> Let's say I know that Joe is from Maine.
> I want to do a query of all employees from Maine, ordered by hiring
> date, and figure out where Joe falls in that list. (i.e. which record
> number is he?)
> --MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> --No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date:
> 3/22/2007 7:44 AM
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=1