Re: Last Name extraction in query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To those who have been so helpful:
I did manage to subscribe to a mysql mailing list.  thanks for the pointers.

As for my orig problem - for those who are intereseted:

The FIELD function apparently doesn't work in 5.0.2, even tho it is in the 
online ref manual.  I was given a suggestion of using INSTR and that worked 
beautifully.  Here's how it looked in my Select statement:

$q = "SELECT race_winner,count(race_date) as wins,
      SUBSTR(race_winner,INSTR(race_winner,' ')+1) as last_name
        FROM `trk_races`
        WHERE race_winner IS NOT NULL
        GROUP BY race_winner
        ORDER BY wins DESC,last_name";


It works just as I wanted it to.

Thanks to all.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux