MySQL table sorting records - alphabetical before numeric

Hi,
I have some records in my MySQL table and when I order by products code (prodcode) I get the following results

P11A      
P11Br      
P11D      
P11G      
P12A.2    
P12A.3    
P14A      
P14B      
P14E      
P17M      
P18C      
P1A

Is it possible to have a mysql query where alphabetical characters have a higher priority than numeric, to produce results similar to below?

P1A  
P1A.1
P1A.2
P2B  
P2E  
P2H  
P2I  
P4A  
P6A  
P6B  
P9C  
P11A  
P11B  

Thanks in advance for you feedba
sabecsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tdotCommented:
Hi, sabecs
select numbers from whatever order by numbers + 0;
0
Richard DavisSenior Web DeveloperCommented:
I don't know what your SELECT statement looks like, but if you try something like this, it might solve your issue.

SELECT * FROM some_table WHERE field_name = 'blah' ORDER BY prodcode + 0 ASC

Hope this helped. :)

~A~
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mkiredjianCommented:
Can you provide more details your table fields sample data from it the result you are getting the result you expect to get
0
sabecsAuthor Commented:
Thanks for your feedback, I need to sort prodcode where alphabetical characters are shown before numeric characters. For example in the list below, P1A & P1G should be at the top.
P11A      
P11Br      
P11D      
P11G      
P12A.2    
P12A.3    
P14A      
P14B      
P14E      
P17M      
P18C      
P1A
P1G

 
0
tdotCommented:
SELECT prodcodes FROM table WHERE field = 'something' ORDER BY prodcode  ASC
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.