Can i order by JUST the first letter of a string in SQL?

Posted on 2008-06-13
Last Modified: 2012-06-21
is it possible to order by only the first letter of a string in SQL?  for instance, here is my order by:

ORDER BY Silage_Corn_Hybrids_with_Same_Base_Genetics, dbo.parseInt(Silage_Corn_Relative_Maturity), Silage_Corn_Parent_Hybrid

and i have attached how my data is returning.  

i would like it to just display the 'F' Silage_Corn_Hybrids_with_Same_Base_Genetics first and the the 'T', but really sort by Silage_Corn_Relative_Maturity with the Silage_Corn_Parent_Hybrid family.

Is this possible?

F2F297	F2F297	90

F2F444	F2F444	102

F2F449	F2F444	104

F2F485	F2F485	98

F2F487	F2F485	99

F2F489	F2F485	99

F2F566	F2F566	105

F2F568	F2F566	105

F2F569	F2F566	105

F2F610	F2F610	108

F2F631	F2F631	110

F2F633	F2F631	110

F2F635	F2F631	110

F2F682	F2F682	112

F2F699	F697	113

F2F700	F697	113

F2F721	F2F721	113

F2F723	F2F721	113

F2F725	F2F721	113

F2F739	F2F739	113

F2F797	F2F797	115

F697	F697	112

TMF2H917	TMF2H917	123

TMF2H918	TMF2H917	123

TMF2L412	TMF2L412	92

TMF2L414	TMF2L412	92

TMF2L416	TMF2L412	94

TMF2L418	TMF2L412	94

TMF2L831	TMF2L831	118

TMF2L844	TMF2L844	119

TMF2M696	TMF2M696	110

TMF2N422	TMF2N422	94

TMF2N494	TMF94	        97

TMF2N602	TMF2N602	106

TMF2N804	TMF2N804	116

TMF2P719	TMF2P719	110

TMF2Q296	TMF2Q296	86

TMF2Q714	TMF2Q714	109

TMF2Q715	TMF2Q714	108

TMF2Q716	TMF2Q714	109

TMF2Q733	TMF2Q733	113

TMF2Q753	TMF2Q753	113

TMF2Q759	TMF2Q753	113

TMF2R521	TMF2R521	102

TMF2T497	TMF2T497	100

TMF2W583	TMF2W583	104

TMF2W587	TMF2W583	104

TMF2W726	TMF2W726	111

TMF94	        TMF94	        97

Open in new window

Question by:tarashea
LVL 60

Accepted Solution

chapmandew earned 500 total points
ID: 21781930
select * from tablename
order by left(fieldname,1)

Author Closing Comment

ID: 31467048
excellent!  thanks a bunch!

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now