Mast head image

The Five Soils with Greatest Acreage in an MLRA for a Selected State

This script ranks the top five soils with greatest acreage in an MLRA for a selected State. The number of soils can be changed to see more or fewer soils


Text highlighted in yellow in the example script can be changed to a particular area, e.g. 'MO123' could replace 'OH%' or another State. Examples can be found on the Tips page.

Tips Page

Copy the example script below and paste it into the query page on the Soil Data Access site.

Soil Data Access Query Page

Example Script

SELECT SUM(mo.areaovacres*comppct_r/100) over (partition by compname,lo.areasymbol) as total_acres, compname,

lo.areasymbol, m.musym, m.muname, m.muacres, mo.areaovacres

INTO #T1

FROM legend AS l

INNER JOIN laoverlap AS lo ON lo.lkey=l.lkey and l.areasymbol LIKE 'OH%'

INNER JOIN muaoverlap AS mo ON mo.lareaovkey = lo.lareaovkey

INNER JOIN component AS c ON c.mukey=mo.mukey and majcompflag='yes'

INNER JOIN mapunit AS m ON m.mukey=c.mukey and m.mukey=mo.mukey

where lo.areatypename ='mlra'

select distinct compname, total_acres, areasymbol

INTO #T2

from #T1

order by total_acres desc, areasymbol

select compname, total_acres, areasymbol,

RANK() over (partition by areasymbol order by total_acres desc) as rank_area

INTO #T3

from #T2

select compname AS Component_name, total_acres AS Total_acres, areasymbol AS MLRA_symbol, rank_area AS Ranking_by_area

FROM #T3

Where rank_area <6

DROP TABLE #T1

DROP TABLE #T2

DROP TABLE #T3

Example Table Output

Description of tables and columns can be found on this link: Table and Column Descriptions

Component_name Total_acres MLRA_symbol Ranking_by_area
Crosby 528333 111A 1
Miamian 456042 111A 2
Kokomo 267553 111A 3
Celina 246851 111A 4
Brookston 233364 111A 5



Helping People Help the Land

USDA is an equal opportunity provider, employer, and lender.