Link to home
Start Free TrialLog in
Avatar of tarashea
tarashea

asked on

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

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

ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tarashea
tarashea

ASKER

excellent!  thanks a bunch!