Hi,

Yep, that did the trick. Didn't know that existed. VERY handy. Thanks  
very much.

Mark

-------------

On Jan 29, 2008, at 12:33 AM, Marius Bocean wrote:

> assunming that the filed is named names
>
> select *,substring_index(names, ' ', -1) as last order by last
>
> will return a field with the last name in it attached to the table  
> ordered by this great great field.
> anyway chack the syntax
> hth
>
>   ----- Original Message -----
>   From: Wade Smart
>   To: [email protected]
>   Sent: Tuesday, January 29, 2008 4:03 AM
>   Subject: Re: [php_mysql] Sort by Last name
>
>
>   Mark Wheeler wrote:
>> Hi,
>>
>> Just a quick question. Is it possible to sort a table by last name
>> when the first and last name are in the same field? For example, if I
>> had to sort the following by last name:
>>
>> Jim Berg
>> Ray Shwartz
>> Al Peking
>> Nick Cutter
>>
>> How would, if it can, be done within the query? Again, each field has
>> the first and last name in it.
>>
>> Thanks,
>>
>> Mark

Reply via email to