Ralat dalam SQL
SELECT TOP 20 START AT 1 rc.CommodityId, rc.CommodityCategoryCd, rcc.CommodityCategoryNm, rc.CommodityGroupCd, rcg.CommodityGroupNm, rc.CommodityTypeCd, rct.CommodityTypeNm, rc.CommodityVarietyCd, rcv.CommodityVarietyNm, rc.CommodityLevel, rl.LevelNm, rc.CommodityGrade, rg.Grade, rc.CommodityUnit, ru.Unit, rc.CommodityType, (CASE rc.CommodityType when 'D' then 'HARIAN' when 'W' then 'MINGGUAN' else 'TIADA MAKLUMAT' end) AS CommodityType2, rc.CommoditySource, rcs.CommoditySource as CommoditySourceNm FROM tblrefcommodity rc INNER JOIN tblrefCommodityCategory rcc ON rc.CommodityCategoryCd = rcc.CommodityCategoryCd INNER JOIN tblrefCommodityGroup rcg ON rc.CommodityCategoryCd = rcg.CommodityCategoryCd AND rc.CommodityGroupCd = rcg.CommodityGroupCd INNER JOIN tblrefCommodityType rct ON rc.CommodityCategoryCd = rct.CommodityCategoryCd AND rc.CommodityGroupCd = rct.CommodityGroupCd AND rc.CommodityTypeCd = rct.CommodityTypeCd INNER JOIN tblrefCommodityVariety rcv ON rc.CommodityCategoryCd = rcv.CommodityCategoryCd AND rc.CommodityGroupCd = rcv.CommodityGroupCd AND rc.CommodityTypeCd = rcv.CommodityTypeCd AND rc.CommodityVarietyCd = rcv.CommodityVarietyCd INNER JOIN tblRefLevel rl ON rc.CommodityLevel = rl.levelCd INNER JOIN tblRefGrade rg ON rc.CommodityGrade = rg.GradeCd INNER JOIN tblRefUnit ru ON rc.CommodityUnit = ru.UnitCd INNER JOIN tblRefCommoditySource rcs ON rc.CommoditySource = rcs.CommoditySourceCd WHERE ru.Unit IS NOT NULL ORDER BY rcv.CommodityVarietyNm